Class: ArrayOfString
- Inherits:
-
Object
- Object
- ArrayOfString
- Defined in:
- lib/array_of_string.rb
Instance Attribute Summary collapse
-
#string_sets ⇒ Object
readonly
Returns the value of attribute string_sets.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(string_sets) ⇒ ArrayOfString
constructor
A new instance of ArrayOfString.
Constructor Details
#initialize(string_sets) ⇒ ArrayOfString
Returns a new instance of ArrayOfString.
5 6 7 |
# File 'lib/array_of_string.rb', line 5 def initialize(string_sets) @string_sets = string_sets end |
Instance Attribute Details
#string_sets ⇒ Object (readonly)
Returns the value of attribute string_sets.
4 5 6 |
# File 'lib/array_of_string.rb', line 4 def string_sets @string_sets end |
Class Method Details
.parse(xml) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/array_of_string.rb', line 9 def self.parse(xml) # debugger # doc = Nokogiri::XML(xml) sets = xml.css("ArrayOfString > string").map do |product_name| StringSet.from_xml(product_name) end new(sets) end |