Class: GPUEater::APIv1::ProductsResnpose

Inherits:
Object
  • Object
show all
Defined in:
lib/gpueater.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#imagesObject

Returns the value of attribute images.



94
95
96
# File 'lib/gpueater.rb', line 94

def images
  @images
end

#productsObject

Returns the value of attribute products.



96
97
98
# File 'lib/gpueater.rb', line 96

def products
  @products
end

#ssh_keysObject

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_sObject



111
112
113
# File 'lib/gpueater.rb', line 111

def to_s
[@images,@ssh_keys,@products].to_s
end