Class: QuickMug::Image
- Inherits:
-
Object
- Object
- QuickMug::Image
- Defined in:
- lib/quickmug/image.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Class Method Summary collapse
Instance Method Summary collapse
- #apiHash ⇒ Object
- #info ⇒ Object
-
#initialize(id, key) ⇒ Image
constructor
A new instance of Image.
- #render ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(id, key) ⇒ Image
Returns a new instance of Image.
5 6 7 8 |
# File 'lib/quickmug/image.rb', line 5 def initialize(id, key) @id = id @key = key end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/quickmug/image.rb', line 3 def id @id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
3 4 5 |
# File 'lib/quickmug/image.rb', line 3 def key @key end |
Class Method Details
Instance Method Details
#apiHash ⇒ Object
10 11 12 |
# File 'lib/quickmug/image.rb', line 10 def apiHash {:ImageID => @id, :ImageKey => @key} end |
#info ⇒ Object
14 15 16 |
# File 'lib/quickmug/image.rb', line 14 def info @info ||= QuickMug.client.images.getInfo(apiHash) end |
#render ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/quickmug/image.rb', line 22 def render output = QuickMug.config['format'] info.each do |key, value| output = output.gsub("[#{key}]", value.to_s) end output end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/quickmug/image.rb', line 18 def to_s render end |