Class: VersionOne::Meta
- Inherits:
-
Object
- Object
- VersionOne::Meta
- Defined in:
- lib/version-one/meta.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(xml) ⇒ Meta
constructor
A new instance of Meta.
- #inspect ⇒ Object
Constructor Details
#initialize(xml) ⇒ Meta
Returns a new instance of Meta.
10 11 12 |
# File 'lib/version-one/meta.rb', line 10 def initialize(xml) parse_xml(xml) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
8 9 10 |
# File 'lib/version-one/meta.rb', line 8 def attributes @attributes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/version-one/meta.rb', line 7 def name @name end |
Class Method Details
.get(asset_type, client = nil) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/version-one/meta.rb', line 14 def self.get(asset_type, client=nil) client ||= VersionOne::Client.new xml = client.get('/meta.v1/' + asset_type, cache: { key: "VersionOne/meta/#{asset_type}", options: { expires_in: 60 * 60 * 24, race_condition_ttl: 5 } }) new(xml) end |
Instance Method Details
#[](name) ⇒ Object
28 29 30 |
# File 'lib/version-one/meta.rb', line 28 def [](name) @named_attributes[name] end |
#inspect ⇒ Object
32 33 34 |
# File 'lib/version-one/meta.rb', line 32 def inspect '#<Meta:%s>' % [self.name] end |