Class: XwotDiscovery::XwotResource
- Inherits:
-
Object
- Object
- XwotDiscovery::XwotResource
- Defined in:
- lib/xwot_discovery/resource.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#interface ⇒ Object
readonly
Returns the value of attribute interface.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#urn ⇒ Object
readonly
Returns the value of attribute urn.
Instance Method Summary collapse
-
#initialize(a_hash) ⇒ XwotResource
constructor
A new instance of XwotResource.
- #payload ⇒ Object
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
#description ⇒ Object (readonly)
Returns the value of attribute description.
5 6 7 |
# File 'lib/xwot_discovery/resource.rb', line 5 def description @description end |
#interface ⇒ Object (readonly)
Returns the value of attribute interface.
5 6 7 |
# File 'lib/xwot_discovery/resource.rb', line 5 def interface @interface end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
5 6 7 |
# File 'lib/xwot_discovery/resource.rb', line 5 def location @location end |
#urn ⇒ Object (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
#payload ⇒ Object
14 15 16 |
# File 'lib/xwot_discovery/resource.rb', line 14 def payload JSON.generate(@description) end |