Class: XRay::SubMeta
- Inherits:
-
Object
- Object
- XRay::SubMeta
- Defined in:
- lib/aws-xray-sdk/model/metadata.rb
Overview
The actual class that stores all data under a certain namespace.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(k, v) ⇒ Object
-
#initialize(entity) ⇒ SubMeta
constructor
A new instance of SubMeta.
- #to_h ⇒ Object
- #to_json ⇒ Object
- #update(h) ⇒ Object
Constructor Details
#initialize(entity) ⇒ SubMeta
Returns a new instance of SubMeta.
30 31 32 33 |
# File 'lib/aws-xray-sdk/model/metadata.rb', line 30 def initialize(entity) @data = {} @entity = entity end |
Instance Method Details
#[](key) ⇒ Object
35 36 37 |
# File 'lib/aws-xray-sdk/model/metadata.rb', line 35 def [](key) @data[key] end |
#[]=(k, v) ⇒ Object
39 40 41 42 |
# File 'lib/aws-xray-sdk/model/metadata.rb', line 39 def []=(k, v) raise EntityClosedError if @entity.closed? @data[k] = v end |
#to_h ⇒ Object
49 50 51 |
# File 'lib/aws-xray-sdk/model/metadata.rb', line 49 def to_h @data end |
#to_json ⇒ Object
53 54 55 56 57 |
# File 'lib/aws-xray-sdk/model/metadata.rb', line 53 def to_json @to_json ||= begin MultiJson.dump to_h end end |
#update(h) ⇒ Object
44 45 46 47 |
# File 'lib/aws-xray-sdk/model/metadata.rb', line 44 def update(h) raise EntityClosedError if @entity.closed? @data.merge!(h) end |