Class: SilverlineAPI::Container
- Inherits:
-
Object
- Object
- SilverlineAPI::Container
- Defined in:
- lib/librato_silverline_api.rb
Instance Attribute Summary collapse
-
#cpu ⇒ Object
Returns the value of attribute cpu.
-
#mem ⇒ Object
Returns the value of attribute mem.
-
#name ⇒ Object
Returns the value of attribute name.
-
#network_rbw ⇒ Object
Returns the value of attribute network_rbw.
-
#network_wbw ⇒ Object
Returns the value of attribute network_wbw.
-
#storage_rbw ⇒ Object
Returns the value of attribute storage_rbw.
-
#storage_wbw ⇒ Object
Returns the value of attribute storage_wbw.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Container
constructor
A new instance of Container.
- #to_json(x = nil) ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Container
Returns a new instance of Container.
171 172 173 174 175 176 177 178 179 |
# File 'lib/librato_silverline_api.rb', line 171 def initialize(args = {}) @name = args[:name] @cpu = args[:cpu] ? Axis.new(args[:cpu]) : Axis.new @mem = args[:mem] ? Axis.new(args[:mem]) : Axis.new @network_rbw = args[:network_rbw] ? Axis.new(args[:network_rbw]) : Axis.new @network_wbw = args[:network_wbw] ? Axis.new(args[:network_wbw]) : Axis.new @storage_rbw = args[:storage_rbw] ? Axis.new(args[:storage_rbw]) : Axis.new @storage_wbw = args[:storage_wbw] ? Axis.new(args[:storage_wbw]) : Axis.new end |
Instance Attribute Details
#cpu ⇒ Object
Returns the value of attribute cpu.
169 170 171 |
# File 'lib/librato_silverline_api.rb', line 169 def cpu @cpu end |
#mem ⇒ Object
Returns the value of attribute mem.
169 170 171 |
# File 'lib/librato_silverline_api.rb', line 169 def mem @mem end |
#name ⇒ Object
Returns the value of attribute name.
169 170 171 |
# File 'lib/librato_silverline_api.rb', line 169 def name @name end |
#network_rbw ⇒ Object
Returns the value of attribute network_rbw.
169 170 171 |
# File 'lib/librato_silverline_api.rb', line 169 def network_rbw @network_rbw end |
#network_wbw ⇒ Object
Returns the value of attribute network_wbw.
169 170 171 |
# File 'lib/librato_silverline_api.rb', line 169 def network_wbw @network_wbw end |
#storage_rbw ⇒ Object
Returns the value of attribute storage_rbw.
169 170 171 |
# File 'lib/librato_silverline_api.rb', line 169 def storage_rbw @storage_rbw end |
#storage_wbw ⇒ Object
Returns the value of attribute storage_wbw.
169 170 171 |
# File 'lib/librato_silverline_api.rb', line 169 def storage_wbw @storage_wbw end |
Instance Method Details
#to_json(x = nil) ⇒ Object
181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/librato_silverline_api.rb', line 181 def to_json(x = nil) { :name => @name, :cpu => @cpu, :mem => @mem, :network_rbw => @network_rbw, :network_wbw => @network_wbw, :storage_rbw => @storage_rbw, :storage_wbw => @storage_wbw }.to_json end |