Class: Distribunaut::Tuple
- Inherits:
-
Object
- Object
- Distribunaut::Tuple
- Defined in:
- lib/distribunaut/tuple.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
Returns the value of attribute app_name.
-
#description ⇒ Object
Returns the value of attribute description.
-
#object ⇒ Object
Returns the value of attribute object.
-
#space ⇒ Object
Returns the value of attribute space.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(values = {}) ⇒ Tuple
constructor
A new instance of Tuple.
- #to_array ⇒ Object
- #to_search_array ⇒ Object
Constructor Details
#initialize(values = {}) ⇒ Tuple
Returns a new instance of Tuple.
10 11 12 13 14 |
# File 'lib/distribunaut/tuple.rb', line 10 def initialize(values = {}) values.each do |k, v| self.send("#{k}=", v) end end |
Instance Attribute Details
#app_name ⇒ Object
Returns the value of attribute app_name.
4 5 6 |
# File 'lib/distribunaut/tuple.rb', line 4 def app_name @app_name end |
#description ⇒ Object
Returns the value of attribute description.
7 8 9 |
# File 'lib/distribunaut/tuple.rb', line 7 def description @description end |
#object ⇒ Object
Returns the value of attribute object.
6 7 8 |
# File 'lib/distribunaut/tuple.rb', line 6 def object @object end |
#space ⇒ Object
Returns the value of attribute space.
5 6 7 |
# File 'lib/distribunaut/tuple.rb', line 5 def space @space end |
#timeout ⇒ Object
Returns the value of attribute timeout.
8 9 10 |
# File 'lib/distribunaut/tuple.rb', line 8 def timeout @timeout end |
Class Method Details
.from_array(ar) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/distribunaut/tuple.rb', line 26 def from_array(ar) tuple = Distribunaut::Tuple.new tuple.app_name = ar[0] tuple.space = ar[1] tuple.object = ar[2] tuple.description = ar[3] return tuple end |
Instance Method Details
#to_array ⇒ Object
16 17 18 |
# File 'lib/distribunaut/tuple.rb', line 16 def to_array [self.app_name, self.space, self.object, self.description] end |
#to_search_array ⇒ Object
20 21 22 |
# File 'lib/distribunaut/tuple.rb', line 20 def to_search_array [self.app_name, self.space, nil, nil] end |