Class: XCAssets::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/KCommercialPipeline/core/resource/xcassets/image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeImage

Returns a new instance of Image.



11
12
13
14
15
# File 'lib/KCommercialPipeline/core/resource/xcassets/image.rb', line 11

def initialize
  @idiom = 'universal'
  @scale = "2x"
  @resource = nil
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



9
10
11
# File 'lib/KCommercialPipeline/core/resource/xcassets/image.rb', line 9

def filename
  @filename
end

#idiomObject

Returns the value of attribute idiom.



3
4
5
# File 'lib/KCommercialPipeline/core/resource/xcassets/image.rb', line 3

def idiom
  @idiom
end

#resourcePathname

The resource path

Returns:



7
8
9
# File 'lib/KCommercialPipeline/core/resource/xcassets/image.rb', line 7

def resource
  @resource
end

#scaleObject

Returns the value of attribute scale.



4
5
6
# File 'lib/KCommercialPipeline/core/resource/xcassets/image.rb', line 4

def scale
  @scale
end

Instance Method Details

#contentsObject



22
23
24
25
26
27
28
# File 'lib/KCommercialPipeline/core/resource/xcassets/image.rb', line 22

def contents
  hash = {}
  hash[:idiom] = idiom if idiom
  hash[:scale] = scale if scale
  hash[:filename] = filename if filename
  hash
end