Class: GPUEater::APIv1::ProductsResnpose
- Inherits:
-
Object
- Object
- GPUEater::APIv1::ProductsResnpose
- Defined in:
- lib/gpueater.rb
Instance Attribute Summary collapse
-
#images ⇒ Object
Returns the value of attribute images.
-
#products ⇒ Object
Returns the value of attribute products.
-
#ssh_keys ⇒ Object
Returns the value of attribute ssh_keys.
Instance Method Summary collapse
- #find_image(n) ⇒ Object
- #find_product(n) ⇒ Object
- #find_ssh_key(n) ⇒ Object
-
#initialize(j) ⇒ ProductsResnpose
constructor
A new instance of ProductsResnpose.
- #to_s ⇒ Object
Constructor Details
#initialize(j) ⇒ ProductsResnpose
Returns a new instance of ProductsResnpose.
97 98 99 100 101 |
# File 'lib/gpueater.rb', line 97 def initialize(j) @images = j['images'] @ssh_keys = j['ssh_keys'] @products = j['products'] end |
Instance Attribute Details
#images ⇒ Object
Returns the value of attribute images.
94 95 96 |
# File 'lib/gpueater.rb', line 94 def images @images end |
#products ⇒ Object
Returns the value of attribute products.
96 97 98 |
# File 'lib/gpueater.rb', line 96 def products @products end |
#ssh_keys ⇒ Object
Returns the value of attribute ssh_keys.
95 96 97 |
# File 'lib/gpueater.rb', line 95 def ssh_keys @ssh_keys end |
Instance Method Details
#find_image(n) ⇒ Object
102 103 104 |
# File 'lib/gpueater.rb', line 102 def find_image(n) @images.values.select{|v| v['name'] == n }.pop end |
#find_product(n) ⇒ Object
108 109 110 |
# File 'lib/gpueater.rb', line 108 def find_product(n) @products.select{|v| v['name'] == n }.pop end |
#find_ssh_key(n) ⇒ Object
105 106 107 |
# File 'lib/gpueater.rb', line 105 def find_ssh_key(n) @ssh_keys.select{|v| v['name'] == n }.pop end |
#to_s ⇒ Object
111 112 113 |
# File 'lib/gpueater.rb', line 111 def to_s [@images,@ssh_keys,@products].to_s end |