Class: Hawkular::Inventory::Resource

Inherits:
BaseEntity show all
Defined in:
lib/hawkular/inventory/entities.rb

Overview

A Resource is an instantiation of a ResourceType

Instance Attribute Summary collapse

Attributes inherited from BaseEntity

#env, #feed, #id, #name, #path, #properties

Instance Method Summary collapse

Methods inherited from BaseEntity

#==, #to_h

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_pathString (readonly)

Returns Full path of the Hawkular::Inventory::ResourceType

Returns:



63
64
65
# File 'lib/hawkular/inventory/entities.rb', line 63

def type_path
  @type_path
end