Class: Erika::Image
- Inherits:
-
Object
- Object
- Erika::Image
- Defined in:
- lib/erika/image.rb
Instance Attribute Summary collapse
-
#caption ⇒ Object
readonly
Returns the value of attribute caption.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#formatted_index ⇒ Object
readonly
Returns the value of attribute formatted_index.
-
#full_path ⇒ Object
Returns the value of attribute full_path.
-
#index ⇒ Object
Returns the value of attribute index.
-
#temp_path ⇒ Object
readonly
Returns the value of attribute temp_path.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#video ⇒ Object
readonly
Returns the value of attribute video.
Instance Method Summary collapse
- #create_video ⇒ Object
-
#initialize(filename: '', full_path: '', index: 0) ⇒ Image
constructor
A new instance of Image.
-
#resize_move_to_temp ⇒ Object
Chainable method.
Constructor Details
#initialize(filename: '', full_path: '', index: 0) ⇒ Image
Returns a new instance of Image.
6 7 8 9 10 11 12 |
# File 'lib/erika/image.rb', line 6 def initialize filename: '', full_path: '', index: 0 @filename, @full_path, @index = filename, full_path, index @title = filename.sentence_case @formatted_index = '%05d' % index @temp_path = "#{Erika::Default.temp.image_dir}/#{formatted_index}.jpg" end |
Instance Attribute Details
#caption ⇒ Object (readonly)
Returns the value of attribute caption.
4 5 6 |
# File 'lib/erika/image.rb', line 4 def @caption end |
#filename ⇒ Object
Returns the value of attribute filename.
3 4 5 |
# File 'lib/erika/image.rb', line 3 def filename @filename end |
#formatted_index ⇒ Object (readonly)
Returns the value of attribute formatted_index.
4 5 6 |
# File 'lib/erika/image.rb', line 4 def formatted_index @formatted_index end |
#full_path ⇒ Object
Returns the value of attribute full_path.
3 4 5 |
# File 'lib/erika/image.rb', line 3 def full_path @full_path end |
#index ⇒ Object
Returns the value of attribute index.
3 4 5 |
# File 'lib/erika/image.rb', line 3 def index @index end |
#temp_path ⇒ Object (readonly)
Returns the value of attribute temp_path.
4 5 6 |
# File 'lib/erika/image.rb', line 4 def temp_path @temp_path end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'lib/erika/image.rb', line 4 def title @title end |
#video ⇒ Object (readonly)
Returns the value of attribute video.
4 5 6 |
# File 'lib/erika/image.rb', line 4 def video @video end |