Class: Protolink::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/protolink/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#descriptionObject (readonly)

Returns the value of attribute description.



3
4
5
# File 'lib/protolink/node.rb', line 3

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/protolink/node.rb', line 3

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/protolink/node.rb', line 3

def name
  @name
end

#uuidObject (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

Returns:

  • (Boolean)


14
15
16
# File 'lib/protolink/node.rb', line 14

def coupled?
  connection.get("/api/v1/couplings/#{id}")
end