Class: IziLightup::AssetInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/izi_lightup/asset_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, manifest: nil, environment: nil) ⇒ AssetInfo

Returns a new instance of AssetInfo.



9
10
11
12
13
# File 'lib/izi_lightup/asset_info.rb', line 9

def initialize(name, manifest: nil, environment: nil)
  @name = name
  @manifest = manifest
  @environment = environment
end

Instance Attribute Details

#environmentObject (readonly)

Returns the value of attribute environment.



7
8
9
# File 'lib/izi_lightup/asset_info.rb', line 7

def environment
  @environment
end

#manifestObject (readonly)

Returns the value of attribute manifest.



7
8
9
# File 'lib/izi_lightup/asset_info.rb', line 7

def manifest
  @manifest
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/izi_lightup/asset_info.rb', line 7

def name
  @name
end

Instance Method Details

#content_typeObject



24
25
26
# File 'lib/izi_lightup/asset_info.rb', line 24

def content_type
  @content_type ||= detect_content_type
end

#exist?Boolean Also known as: exists?

Returns:

  • (Boolean)


15
16
17
# File 'lib/izi_lightup/asset_info.rb', line 15

def exist?
  @exist ||= check_existence
end

#pathObject



20
21
22
# File 'lib/izi_lightup/asset_info.rb', line 20

def path
  @path ||= detect_path
end

#sizeObject Also known as: dimentions



34
35
36
# File 'lib/izi_lightup/asset_info.rb', line 34

def size
  @size ||= detect_size
end

#typeObject



28
29
30
31
32
# File 'lib/izi_lightup/asset_info.rb', line 28

def type
  return unless exist?

  @type ||= FastImage.type(path)
end