Class: Dozuki::NodeCollection
- Inherits:
-
Object
- Object
- Dozuki::NodeCollection
- Defined in:
- lib/dozuki/node_collection.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
Returns the value of attribute collection.
Instance Method Summary collapse
- #as_boolean(&blk) ⇒ Object
- #as_date(&blk) ⇒ Object
- #as_float(&blk) ⇒ Object
- #as_int(&blk) ⇒ Object
- #as_node(&blk) ⇒ Object
- #as_string(&blk) ⇒ Object
-
#initialize(collection) ⇒ NodeCollection
constructor
A new instance of NodeCollection.
Constructor Details
#initialize(collection) ⇒ NodeCollection
Returns a new instance of NodeCollection.
5 6 7 |
# File 'lib/dozuki/node_collection.rb', line 5 def initialize(collection) self.collection = collection end |
Instance Attribute Details
#collection ⇒ Object
Returns the value of attribute collection.
3 4 5 |
# File 'lib/dozuki/node_collection.rb', line 3 def collection @collection end |
Instance Method Details
#as_boolean(&blk) ⇒ Object
29 30 31 |
# File 'lib/dozuki/node_collection.rb', line 29 def as_boolean(&blk) each_as(Parsers::Boolean, &blk) end |
#as_date(&blk) ⇒ Object
25 26 27 |
# File 'lib/dozuki/node_collection.rb', line 25 def as_date(&blk) each_as(Parsers::Date, &blk) end |
#as_float(&blk) ⇒ Object
21 22 23 |
# File 'lib/dozuki/node_collection.rb', line 21 def as_float(&blk) each_as(Parsers::Float, &blk) end |
#as_int(&blk) ⇒ Object
17 18 19 |
# File 'lib/dozuki/node_collection.rb', line 17 def as_int(&blk) each_as(Parsers::Integer, &blk) end |