Class: Analysand::ViewStreaming::Builder::ObjectNode
- Inherits:
-
Object
- Object
- Analysand::ViewStreaming::Builder::ObjectNode
- Defined in:
- lib/analysand/view_streaming/builder.rb
Overview
Simplifies key/value pair construction.
Instance Method Summary collapse
- #<<(term) ⇒ Object
-
#initialize ⇒ ObjectNode
constructor
A new instance of ObjectNode.
- #to_object ⇒ Object
Constructor Details
#initialize ⇒ ObjectNode
Returns a new instance of ObjectNode.
123 124 125 |
# File 'lib/analysand/view_streaming/builder.rb', line 123 def initialize @obj = {} end |
Instance Method Details
#<<(term) ⇒ Object
131 132 133 134 135 136 137 138 |
# File 'lib/analysand/view_streaming/builder.rb', line 131 def <<(term) if !@key @key = term elsif @key @obj[@key] = term @key = nil end end |
#to_object ⇒ Object
127 128 129 |
# File 'lib/analysand/view_streaming/builder.rb', line 127 def to_object @obj end |