This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class YmlLength | |
| attr_accessor :data, :result | |
| def initialize(path) | |
| self.data = YAML::load_file(Rails.root.join(path)).to_a.flatten.last | |
| self.result = "" | |
| get_value(data) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <objects type="array"> | |
| <object> | |
| <id type="integer">1</id> | |
| <name>Śmietanka łaciata</name> | |
| <description nil="true"/> | |
| <company-name>Mlekpol</company-name> | |
| <ingredients type="array"> | |
| <ingredient> | |
| <id type="integer">1</id> | |
| <number>E339</number> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| List<Product> products; | |
| products = (from item in xdoc.Descendants("object") | |
| select new Product() | |
| { | |
| Name = item.Element("name").Value, | |
| Description = item.Element("description").Value | |
| }).ToList(); |
NewerOlder