Class: Hawkular::Inventory::Resource
- Inherits:
-
BaseEntity
- Object
- BaseEntity
- Hawkular::Inventory::Resource
- Defined in:
- lib/hawkular/inventory/entities.rb
Overview
A Resource is an instantiation of a ResourceType
Instance Attribute Summary collapse
-
#type_path ⇒ String
readonly
Full path of the ResourceType.
Attributes inherited from BaseEntity
#env, #feed, #id, #name, #path, #properties
Instance Method Summary collapse
-
#initialize(res_hash) ⇒ Resource
constructor
A new instance of Resource.
Methods inherited from BaseEntity
Constructor Details
#initialize(res_hash) ⇒ Resource
Returns a new instance of Resource
65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/hawkular/inventory/entities.rb', line 65 def initialize(res_hash) super(res_hash) if res_hash.key? :resourceTypePath @type_path = res_hash[:resourceTypePath] elsif res_hash.key? 'resourceTypePath' @type_path = res_hash['resourceTypePath'] else @type = res_hash['type'] @type_path = res_hash['type']['path'] end end |
Instance Attribute Details
#type_path ⇒ String (readonly)
Returns Full path of the Hawkular::Inventory::ResourceType
63 64 65 |
# File 'lib/hawkular/inventory/entities.rb', line 63 def type_path @type_path end |