Class: Image
- Inherits:
-
Object
- Object
- Image
- Defined in:
- lib/image.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#desc ⇒ Object
readonly
Returns the value of attribute desc.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #get_binding ⇒ Object
-
#initialize(photo, title, desc) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(photo, title, desc) ⇒ Image
Returns a new instance of Image.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/image.rb', line 7 def initialize(photo, title, desc) @title = title @desc = desc @month = Time.now.month.to_s @day = Time.now.day.to_s @year = Time.now.year.to_s @date = @day + @month + @year @filename = photo @last_filename = @date + "_" + photo end |
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
5 6 7 |
# File 'lib/image.rb', line 5 def date @date end |
#desc ⇒ Object (readonly)
Returns the value of attribute desc.
5 6 7 |
# File 'lib/image.rb', line 5 def desc @desc end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
5 6 7 |
# File 'lib/image.rb', line 5 def filename @filename end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/image.rb', line 5 def title @title end |
Instance Method Details
#get_binding ⇒ Object
18 19 20 |
# File 'lib/image.rb', line 18 def get_binding binding end |