Class: XCAssets::ImageSet
- Inherits:
-
Object
- Object
- XCAssets::ImageSet
- Defined in:
- lib/KCommercialPipeline/core/resource/xcassets/imageset.rb
Instance Attribute Summary collapse
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #contents ⇒ Object
-
#initialize(name) ⇒ ImageSet
constructor
A new instance of ImageSet.
- #scale1_image ⇒ Object
- #scale2_image ⇒ Object
- #scale3_image ⇒ Object
Constructor Details
#initialize(name) ⇒ ImageSet
Returns a new instance of ImageSet.
9 10 11 12 13 14 15 |
# File 'lib/KCommercialPipeline/core/resource/xcassets/imageset.rb', line 9 def initialize(name) @name = name @images = [] scale1_image scale2_image scale3_image end |
Instance Attribute Details
#images ⇒ Object (readonly)
Returns the value of attribute images.
7 8 9 |
# File 'lib/KCommercialPipeline/core/resource/xcassets/imageset.rb', line 7 def images @images end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/KCommercialPipeline/core/resource/xcassets/imageset.rb', line 5 def name @name end |
Instance Method Details
#contents ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/KCommercialPipeline/core/resource/xcassets/imageset.rb', line 29 def contents { :info => { :author => :xcode, :version => 1 }, :images => @images.map do |image| image.contents end } end |
#scale1_image ⇒ Object
17 18 19 |
# File 'lib/KCommercialPipeline/core/resource/xcassets/imageset.rb', line 17 def scale1_image scale_image('1x') end |
#scale2_image ⇒ Object
21 22 23 |
# File 'lib/KCommercialPipeline/core/resource/xcassets/imageset.rb', line 21 def scale2_image scale_image('2x') end |
#scale3_image ⇒ Object
25 26 27 |
# File 'lib/KCommercialPipeline/core/resource/xcassets/imageset.rb', line 25 def scale3_image scale_image('3x') end |