Class: Protolink::Node
- Inherits:
-
Object
- Object
- Protolink::Node
- Defined in:
- lib/protolink/node.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
- #coupled? ⇒ Boolean
-
#initialize(connection, attributes = {}) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(connection, attributes = {}) ⇒ Node
Returns a new instance of Node.
5 6 7 8 9 10 11 12 |
# File 'lib/protolink/node.rb', line 5 def initialize(connection, attributes = {}) @connection = connection @id = attributes['id'] @uuid = attributes['uuid'] @name = attributes['name'] @description = attributes['description'] @loaded = false end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/protolink/node.rb', line 3 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/protolink/node.rb', line 3 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/protolink/node.rb', line 3 def name @name end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
3 4 5 |
# File 'lib/protolink/node.rb', line 3 def uuid @uuid end |
Instance Method Details
#coupled? ⇒ Boolean
14 15 16 |
# File 'lib/protolink/node.rb', line 14 def coupled? connection.get("/api/v1/couplings/#{id}") end |