Class: GalleryGenerator::ViewableGallery
- Inherits:
-
Object
- Object
- GalleryGenerator::ViewableGallery
- Defined in:
- lib/m1key_gallery_generator/viewable_gallery.rb
Instance Attribute Summary collapse
-
#blurb ⇒ Object
readonly
Returns the value of attribute blurb.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#map_title ⇒ Object
readonly
Returns the value of attribute map_title.
-
#map_url ⇒ Object
readonly
Returns the value of attribute map_url.
-
#photos ⇒ Object
readonly
Returns the value of attribute photos.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
-
#small_print ⇒ Object
readonly
Returns the value of attribute small_print.
-
#sources ⇒ Object
readonly
Returns the value of attribute sources.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#upload_date ⇒ Object
readonly
Returns the value of attribute upload_date.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
- #get_binding ⇒ Object
-
#initialize(title, description, slug, sources, upload_date, map_url, map_title, year, viewable_photos, small_print, blurb) ⇒ ViewableGallery
constructor
A new instance of ViewableGallery.
- #to_viewable_photos(mutable_viewable_photos) ⇒ Object
- #update_using(*update_functions) ⇒ Object
Constructor Details
#initialize(title, description, slug, sources, upload_date, map_url, map_title, year, viewable_photos, small_print, blurb) ⇒ ViewableGallery
Returns a new instance of ViewableGallery.
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/m1key_gallery_generator/viewable_gallery.rb', line 6 def initialize(title, description, slug, sources, upload_date, map_url, map_title, year, viewable_photos, small_print, blurb) @title = String.new(title) @description = description @slug = slug @sources = sources @upload_date = upload_date @map_url = map_url @map_title = map_title @year = year @photos = viewable_photos @small_print = small_print @blurb = blurb end |
Instance Attribute Details
#blurb ⇒ Object (readonly)
Returns the value of attribute blurb.
5 6 7 |
# File 'lib/m1key_gallery_generator/viewable_gallery.rb', line 5 def blurb @blurb end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
5 6 7 |
# File 'lib/m1key_gallery_generator/viewable_gallery.rb', line 5 def description @description end |
#map_title ⇒ Object (readonly)
Returns the value of attribute map_title.
5 6 7 |
# File 'lib/m1key_gallery_generator/viewable_gallery.rb', line 5 def map_title @map_title end |
#map_url ⇒ Object (readonly)
Returns the value of attribute map_url.
5 6 7 |
# File 'lib/m1key_gallery_generator/viewable_gallery.rb', line 5 def map_url @map_url end |
#photos ⇒ Object (readonly)
Returns the value of attribute photos.
5 6 7 |
# File 'lib/m1key_gallery_generator/viewable_gallery.rb', line 5 def photos @photos end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
5 6 7 |
# File 'lib/m1key_gallery_generator/viewable_gallery.rb', line 5 def slug @slug end |
#small_print ⇒ Object (readonly)
Returns the value of attribute small_print.
5 6 7 |
# File 'lib/m1key_gallery_generator/viewable_gallery.rb', line 5 def small_print @small_print end |
#sources ⇒ Object (readonly)
Returns the value of attribute sources.
5 6 7 |
# File 'lib/m1key_gallery_generator/viewable_gallery.rb', line 5 def sources @sources end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/m1key_gallery_generator/viewable_gallery.rb', line 5 def title @title end |
#upload_date ⇒ Object (readonly)
Returns the value of attribute upload_date.
5 6 7 |
# File 'lib/m1key_gallery_generator/viewable_gallery.rb', line 5 def upload_date @upload_date end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
5 6 7 |
# File 'lib/m1key_gallery_generator/viewable_gallery.rb', line 5 def year @year end |
Instance Method Details
#get_binding ⇒ Object
20 21 22 |
# File 'lib/m1key_gallery_generator/viewable_gallery.rb', line 20 def get_binding binding end |
#to_viewable_photos(mutable_viewable_photos) ⇒ Object
36 37 38 39 40 |
# File 'lib/m1key_gallery_generator/viewable_gallery.rb', line 36 def to_viewable_photos(mutable_viewable_photos) mutable_viewable_photos.map do |mutable_viewable_photo| ViewablePhoto.new(mutable_viewable_photo.id, mutable_viewable_photo.title, mutable_viewable_photo.description, mutable_viewable_photo., mutable_viewable_photo.technical_info) end end |
#update_using(*update_functions) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/m1key_gallery_generator/viewable_gallery.rb', line 24 def update_using(*update_functions) updated_gallery = MutableViewableGallery.new(self) update_functions.each do |update_function| updated_gallery = update_function.call(updated_gallery) end ViewableGallery.new(updated_gallery.title, updated_gallery.description, updated_gallery.slug, updated_gallery.sources, updated_gallery.upload_date, updated_gallery.map_url, updated_gallery.map_title, updated_gallery.year, to_viewable_photos(updated_gallery.photos), updated_gallery.small_print, updated_gallery.blurb) end |