Class: XwotDiscovery::XwotResource

Inherits:
Object
  • Object
show all
Defined in:
lib/xwot_discovery/resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(a_hash) ⇒ XwotResource

Returns a new instance of XwotResource.



7
8
9
10
11
12
# File 'lib/xwot_discovery/resource.rb', line 7

def initialize(a_hash)
  @urn = a_hash[:urn]
  @location = a_hash[:location]
  @interface = a_hash[:interface]
  @description = a_hash[:description]
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



5
6
7
# File 'lib/xwot_discovery/resource.rb', line 5

def description
  @description
end

#interfaceObject (readonly)

Returns the value of attribute interface.



5
6
7
# File 'lib/xwot_discovery/resource.rb', line 5

def interface
  @interface
end

#locationObject (readonly)

Returns the value of attribute location.



5
6
7
# File 'lib/xwot_discovery/resource.rb', line 5

def location
  @location
end

#urnObject (readonly)

Returns the value of attribute urn.



5
6
7
# File 'lib/xwot_discovery/resource.rb', line 5

def urn
  @urn
end

Instance Method Details

#payloadObject



14
15
16
# File 'lib/xwot_discovery/resource.rb', line 14

def payload
  JSON.generate(@description)
end