Class: Jsonify::JsonPair
- Defined in:
- lib/jsonify/json_value.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from JsonValue
Instance Method Summary collapse
- #encode_as_json ⇒ Object
-
#initialize(key, value = nil) ⇒ JsonPair
constructor
A new instance of JsonPair.
Methods inherited from JsonValue
Constructor Details
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
73 74 75 |
# File 'lib/jsonify/json_value.rb', line 73 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
73 74 75 |
# File 'lib/jsonify/json_value.rb', line 73 def value @value end |
Instance Method Details
#encode_as_json ⇒ Object
78 79 80 |
# File 'lib/jsonify/json_value.rb', line 78 def encode_as_json %Q{#{key.encode_as_json}:#{value.encode_as_json}} end |