Class: Scorpio::JSON::ArrayNode
- Includes:
- Arraylike
- Defined in:
- lib/scorpio/json/node.rb
Constant Summary
Constants included from Arraylike
Arraylike::DESTRUCTIVE_METHODS, Arraylike::SAFE_INDEX_ELEMENT_METHODS, Arraylike::SAFE_INDEX_ONLY_METHODS, Arraylike::SAFE_METHODS
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
-
#as_json ⇒ Object
needs redefined after including Enumerable.
- #each ⇒ Object
- #to_ary ⇒ Object
Methods included from Arraylike
#inspect, #pretty_print, #to_s
Methods inherited from Node
#[], #content, #deref, #document_node, #fingerprint, #fragment, #initialize, #inspect, #modified_copy, new_by_type, #object_group_text, #parent_node, #pointer_path, #pretty_print
Methods included from FingerprintHash
Constructor Details
This class inherits a constructor from Scorpio::JSON::Node
Instance Method Details
#as_json ⇒ Object
needs redefined after including Enumerable
208 209 210 |
# File 'lib/scorpio/json/node.rb', line 208 def as_json # needs redefined after including Enumerable Typelike.as_json(content) end |
#each ⇒ Object
196 197 198 199 200 |
# File 'lib/scorpio/json/node.rb', line 196 def each return to_enum(__method__) { content.size } unless block_given? content.each_index { |i| yield self[i] } self end |
#to_ary ⇒ Object
202 203 204 |
# File 'lib/scorpio/json/node.rb', line 202 def to_ary to_a end |