Class: LinodeCluster::Node
- Inherits:
-
Delegator
- Object
- Delegator
- LinodeCluster::Node
- Defined in:
- lib/linode_cluster/node.rb
Overview
Node class
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#ip_address ⇒ Object
Returns the value of attribute ip_address.
Instance Method Summary collapse
- #__getobj__ ⇒ Object
- #__setobj__(obj) ⇒ Object
- #cost_per_month ⇒ Object
-
#initialize(obj, client) ⇒ Node
constructor
A new instance of Node.
- #name ⇒ Object
- #plan ⇒ Object
- #region ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize(obj, client) ⇒ Node
Returns a new instance of Node.
6 7 8 9 10 |
# File 'lib/linode_cluster/node.rb', line 6 def initialize(obj, client) super obj # pass obj to Delegator constructor, required @delegate_sd_obj = obj # store obj for future use @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/linode_cluster/node.rb', line 4 def client @client end |
#ip_address ⇒ Object
Returns the value of attribute ip_address.
4 5 6 |
# File 'lib/linode_cluster/node.rb', line 4 def ip_address @ip_address end |
Instance Method Details
#__getobj__ ⇒ Object
12 13 14 |
# File 'lib/linode_cluster/node.rb', line 12 def __getobj__ @delegate_sd_obj # return object we are delegating to, required end |
#__setobj__(obj) ⇒ Object
16 17 18 |
# File 'lib/linode_cluster/node.rb', line 16 def __setobj__(obj) @delegate_sd_obj = obj end |
#cost_per_month ⇒ Object
36 37 38 |
# File 'lib/linode_cluster/node.rb', line 36 def cost_per_month plan.price end |
#name ⇒ Object
28 29 30 |
# File 'lib/linode_cluster/node.rb', line 28 def name label end |
#plan ⇒ Object
32 33 34 |
# File 'lib/linode_cluster/node.rb', line 32 def plan client.find_plan_by_id(planid) end |
#region ⇒ Object
20 21 22 |
# File 'lib/linode_cluster/node.rb', line 20 def region client.find_datacenter_by_id(datacenterid).abbr end |
#size ⇒ Object
24 25 26 |
# File 'lib/linode_cluster/node.rb', line 24 def size plan.ram end |