Class: Rightstuff::ArrayInstance
- Defined in:
- lib/rightstuff/array_instance.rb
Overview
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Class Method Summary collapse
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(client, item) ⇒ ArrayInstance
constructor
A new instance of ArrayInstance.
- #inputs ⇒ Object
- #method_missing(name, *args, &block) ⇒ Object
Methods inherited from Base
extract_attributes, load_collection
Constructor Details
#initialize(client, item) ⇒ ArrayInstance
Returns a new instance of ArrayInstance.
7 8 9 10 |
# File 'lib/rightstuff/array_instance.rb', line 7 def initialize( client, item ) @inputs = nil super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/rightstuff/array_instance.rb', line 16 def method_missing( name , *args, &block ) result = super return result unless result.nil? return nil if @attributes[ :state ] == 'stopped' return @attributes[ name ] end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/rightstuff/array_instance.rb', line 5 def attributes @attributes end |
Class Method Details
.collection_xpath ⇒ Object
12 13 14 |
# File 'lib/rightstuff/array_instance.rb', line 12 def self.collection_xpath '/instances/instance' end |
Instance Method Details
#id ⇒ Object
23 24 25 |
# File 'lib/rightstuff/array_instance.rb', line 23 def id @attributes[ :href ].split( '/' ).last end |
#inputs ⇒ Object
27 28 29 30 31 |
# File 'lib/rightstuff/array_instance.rb', line 27 def inputs return @inputs if @inputs # Add inputs to instance data # @client.get( @attributes[ 'href' ] ) end |