Class: Rightstuff::ArrayInstance

Inherits:
Base
  • Object
show all
Defined in:
lib/rightstuff/array_instance.rb

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#attributesObject (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_xpathObject



12
13
14
# File 'lib/rightstuff/array_instance.rb', line 12

def self.collection_xpath
  '/instances/instance'
end

Instance Method Details

#idObject



23
24
25
# File 'lib/rightstuff/array_instance.rb', line 23

def id
  @attributes[ :href ].split( '/' ).last
end

#inputsObject



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