Class: GallerizeCli::Image::Version
- Inherits:
-
Object
- Object
- GallerizeCli::Image::Version
- Includes:
- FileUtils::Verbose
- Defined in:
- lib/gallerize_cli/image/version.rb
Constant Summary collapse
- GRAVITY_TYPES =
[:north_west, :north, :north_east, :east, :south_east, :south, :south_west, :west, :center]
Instance Attribute Summary collapse
-
#image ⇒ Object
Returns the value of attribute image.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #config ⇒ Object
- #file_path ⇒ Object
- #height ⇒ Object
-
#initialize(image, name, options) ⇒ Version
constructor
A new instance of Version.
- #method ⇒ Object
- #process ⇒ Object
- #url ⇒ Object
- #valid? ⇒ Boolean
- #width ⇒ Object
Constructor Details
#initialize(image, name, options) ⇒ Version
Returns a new instance of Version.
13 14 15 16 17 18 |
# File 'lib/gallerize_cli/image/version.rb', line 13 def initialize(image, name, ) @image = image @name = name @options = OpenStruct.new() @valid = true end |
Instance Attribute Details
#image ⇒ Object
Returns the value of attribute image.
9 10 11 |
# File 'lib/gallerize_cli/image/version.rb', line 9 def image @image end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/gallerize_cli/image/version.rb', line 9 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
9 10 11 |
# File 'lib/gallerize_cli/image/version.rb', line 9 def @options end |
Instance Method Details
#config ⇒ Object
48 49 50 |
# File 'lib/gallerize_cli/image/version.rb', line 48 def config image.config end |
#file_path ⇒ Object
28 29 30 |
# File 'lib/gallerize_cli/image/version.rb', line 28 def file_path @file_path ||= load_file_path end |
#height ⇒ Object
36 37 38 |
# File 'lib/gallerize_cli/image/version.rb', line 36 def height .height.to_i end |
#method ⇒ Object
40 41 42 |
# File 'lib/gallerize_cli/image/version.rb', line 40 def method .method end |
#process ⇒ Object
20 21 22 |
# File 'lib/gallerize_cli/image/version.rb', line 20 def process generate end |
#url ⇒ Object
24 25 26 |
# File 'lib/gallerize_cli/image/version.rb', line 24 def url file_path.to_s.gsub(image.directory.output_path, config.site_url) end |
#valid? ⇒ Boolean
44 45 46 |
# File 'lib/gallerize_cli/image/version.rb', line 44 def valid? !!@valid end |
#width ⇒ Object
32 33 34 |
# File 'lib/gallerize_cli/image/version.rb', line 32 def width .width.to_i end |