Class: KudagoClient::Entities::Image
- Inherits:
-
Object
- Object
- KudagoClient::Entities::Image
- Defined in:
- lib/kudago_client/entities/image.rb
Instance Attribute Summary collapse
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#thumbnails ⇒ Object
readonly
Returns the value of attribute thumbnails.
Instance Method Summary collapse
-
#initialize(image:, thumbnails: {}, source: {}) ⇒ Image
constructor
A new instance of Image.
- #source_link ⇒ Object
- #source_name ⇒ Object
- #thumbnail(size) ⇒ Object
Constructor Details
#initialize(image:, thumbnails: {}, source: {}) ⇒ Image
Returns a new instance of Image.
8 9 10 11 12 |
# File 'lib/kudago_client/entities/image.rb', line 8 def initialize(image:, thumbnails: {}, source: {}) @image = image @thumbnails = thumbnails @source = source end |
Instance Attribute Details
#image ⇒ Object (readonly)
Returns the value of attribute image.
6 7 8 |
# File 'lib/kudago_client/entities/image.rb', line 6 def image @image end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
6 7 8 |
# File 'lib/kudago_client/entities/image.rb', line 6 def source @source end |
#thumbnails ⇒ Object (readonly)
Returns the value of attribute thumbnails.
6 7 8 |
# File 'lib/kudago_client/entities/image.rb', line 6 def thumbnails @thumbnails end |
Instance Method Details
#source_link ⇒ Object
18 19 20 |
# File 'lib/kudago_client/entities/image.rb', line 18 def source_link @source[:link] end |
#source_name ⇒ Object
22 23 24 |
# File 'lib/kudago_client/entities/image.rb', line 22 def source_name @source[:name] end |
#thumbnail(size) ⇒ Object
14 15 16 |
# File 'lib/kudago_client/entities/image.rb', line 14 def thumbnail(size) @thumbnails[size] end |