Class: IziLightup::AssetInfo
- Inherits:
-
Object
- Object
- IziLightup::AssetInfo
- Defined in:
- lib/izi_lightup/asset_info.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#manifest ⇒ Object
readonly
Returns the value of attribute manifest.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #content_type ⇒ Object
- #exist? ⇒ Boolean (also: #exists?)
-
#initialize(name, manifest: nil, environment: nil) ⇒ AssetInfo
constructor
A new instance of AssetInfo.
- #path ⇒ Object
- #size ⇒ Object (also: #dimentions)
- #type ⇒ Object
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
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
7 8 9 |
# File 'lib/izi_lightup/asset_info.rb', line 7 def environment @environment end |
#manifest ⇒ Object (readonly)
Returns the value of attribute manifest.
7 8 9 |
# File 'lib/izi_lightup/asset_info.rb', line 7 def manifest @manifest end |
#name ⇒ Object (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_type ⇒ Object
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?
15 16 17 |
# File 'lib/izi_lightup/asset_info.rb', line 15 def exist? @exist ||= check_existence end |
#path ⇒ Object
20 21 22 |
# File 'lib/izi_lightup/asset_info.rb', line 20 def path @path ||= detect_path end |
#size ⇒ Object Also known as: dimentions
34 35 36 |
# File 'lib/izi_lightup/asset_info.rb', line 34 def size @size ||= detect_size end |
#type ⇒ Object
28 29 30 31 32 |
# File 'lib/izi_lightup/asset_info.rb', line 28 def type return unless exist? @type ||= FastImage.type(path) end |