Class: TentD::API::CoreProfileData
- Inherits:
-
Hashie::Mash
- Object
- Hashie::Mash
- TentD::API::CoreProfileData
- Defined in:
- lib/tentd/api/core_profile_data.rb
Instance Method Summary collapse
- #entity ⇒ Object
- #entity?(entity) ⇒ Boolean
- #expected_version ⇒ Object
- #licenses ⇒ Object
- #servers ⇒ Object
- #version ⇒ Object
- #version_key ⇒ Object
- #versions ⇒ Object
Instance Method Details
#entity ⇒ Object
36 37 38 |
# File 'lib/tentd/api/core_profile_data.rb', line 36 def entity self[version_key][:entity] end |
#entity?(entity) ⇒ Boolean
28 29 30 |
# File 'lib/tentd/api/core_profile_data.rb', line 28 def entity?(entity) self[version_key][:entity] == entity end |
#expected_version ⇒ Object
6 7 8 9 10 |
# File 'lib/tentd/api/core_profile_data.rb', line 6 def expected_version v = TentVersion.from_uri(Model::ProfileInfo::TENT_PROFILE_TYPE_URI) v.parts = v.parts[0..-2] << 'x' v end |
#licenses ⇒ Object
40 41 42 |
# File 'lib/tentd/api/core_profile_data.rb', line 40 def licenses self[version_key][:licenses] end |
#servers ⇒ Object
32 33 34 |
# File 'lib/tentd/api/core_profile_data.rb', line 32 def servers self[version_key][:servers] end |
#version ⇒ Object
18 19 20 21 22 |
# File 'lib/tentd/api/core_profile_data.rb', line 18 def version versions.find do |v| v == expected_version end end |
#version_key ⇒ Object
24 25 26 |
# File 'lib/tentd/api/core_profile_data.rb', line 24 def version_key Model::ProfileInfo::TENT_PROFILE_TYPE_URI.sub(%r|/v.*?$|, '/v' << version.to_s) end |
#versions ⇒ Object
12 13 14 15 16 |
# File 'lib/tentd/api/core_profile_data.rb', line 12 def versions keys.select { |key| key =~ %r|^#{Model::ProfileInfo::TENT_PROFILE_TYPE_URI.sub(/\/v.*?$/, '')}| }.map { |key| TentVersion.from_uri(key) }.sort end |