Class: DNApi::Components::Metadata

Inherits:
OpenStruct
  • Object
show all
Includes:
DNApi::Component
Defined in:
lib/dnapi/components/metadata.rb

Direct Known Subclasses

AppMetadata, EnvironmentMetadata

Instance Method Summary collapse

Methods included from DNApi::Component

[], #can_belong_to?, components, from, included, #key, #to_hash

Instance Method Details

#[](key) ⇒ Object



10
11
12
# File 'lib/dnapi/components/metadata.rb', line 10

def [](key)
  self.send(key)
end

#to_json(*args) ⇒ Object



15
16
17
18
19
# File 'lib/dnapi/components/metadata.rb', line 15

def to_json(*args)
  vals = @table.clone
  vals.delete :parent
  JSON.dump(({:key => key}).merge(vals))
end