Class: Colombo::Image
- Inherits:
-
Object
- Object
- Colombo::Image
- Defined in:
- lib/colombo/image.rb
Instance Attribute Summary collapse
-
#distribution ⇒ Object
Returns the value of attribute distribution.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #destroy(confirm = false) ⇒ Object
-
#initialize(client, images, image_hash) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(client, images, image_hash) ⇒ Image
7 8 9 10 11 12 |
# File 'lib/colombo/image.rb', line 7 def initialize(client, images, image_hash) @client = client image_hash.each do |key, value| __send__("#{key}=", value) if self.respond_to?( key.to_sym ) end end |
Instance Attribute Details
#distribution ⇒ Object
Returns the value of attribute distribution.
5 6 7 |
# File 'lib/colombo/image.rb', line 5 def distribution @distribution end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/colombo/image.rb', line 5 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/colombo/image.rb', line 5 def name @name end |
Instance Method Details
#destroy(confirm = false) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/colombo/image.rb', line 14 def destroy(confirm=false) return unless confirm @client.request(:get, "/images/#{self.id}/destroy/") do |response| return response['event_id'] end end |