Class: SocketLabs::InjectionApi::Core::Serialization::MetadataJson
- Inherits:
-
Object
- Object
- SocketLabs::InjectionApi::Core::Serialization::MetadataJson
- Defined in:
- lib/socketlabs/injectionapi/core/serialization/metadata_json.rb
Overview
Represents metadata as a key and value pair. To be serialized into JSON string before sending to the Injection Api.
Instance Attribute Summary collapse
-
#key ⇒ Object
key of the metadata.
-
#value ⇒ Object
value of the metadata.
Instance Method Summary collapse
-
#initialize(key = nil, value = nil) ⇒ MetadataJson
constructor
Initializes a new instance of the MetadataJson class.
-
#to_hash ⇒ hash
build json hash for MetadataJson.
Constructor Details
#initialize(key = nil, value = nil) ⇒ MetadataJson
Initializes a new instance of the MetadataJson class
18 19 20 21 22 23 24 |
# File 'lib/socketlabs/injectionapi/core/serialization/metadata_json.rb', line 18 def initialize( key = nil, value = nil ) @key = key @value = value end |
Instance Attribute Details
#key ⇒ Object
key of the metadata.
11 12 13 |
# File 'lib/socketlabs/injectionapi/core/serialization/metadata_json.rb', line 11 def key @key end |
#value ⇒ Object
value of the metadata.
13 14 15 |
# File 'lib/socketlabs/injectionapi/core/serialization/metadata_json.rb', line 13 def value @value end |
Instance Method Details
#to_hash ⇒ hash
build json hash for MetadataJson
28 29 30 31 32 33 |
# File 'lib/socketlabs/injectionapi/core/serialization/metadata_json.rb', line 28 def to_hash { :key => @key, :value => @value } end |