Class: Supply::Listing
- Inherits:
-
Object
- Object
- Supply::Listing
- Defined in:
- supply/lib/supply/listing.rb
Instance Attribute Summary collapse
-
#full_description ⇒ Object
Returns the value of attribute full_description.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#short_description ⇒ Object
Returns the value of attribute short_description.
-
#title ⇒ Object
Returns the value of attribute title.
-
#video ⇒ Object
Returns the value of attribute video.
Instance Method Summary collapse
-
#initialize(google_api, language, source_listing = nil) ⇒ Listing
constructor
Initializes the listing to use the given api client, language, and fills it with the current listing if available.
-
#save ⇒ Object
Updates the listing in the current edit.
Constructor Details
#initialize(google_api, language, source_listing = nil) ⇒ Listing
Initializes the listing to use the given api client, language, and fills it with the current listing if available
11 12 13 14 15 16 17 18 19 20 21 |
# File 'supply/lib/supply/listing.rb', line 11 def initialize(google_api, language, source_listing = nil) @google_api = google_api @language = language if source_listing # this might be nil, e.g. when creating a new locale self.title = source_listing.title self.short_description = source_listing.short_description self.full_description = source_listing.full_description self.video = source_listing.video end end |
Instance Attribute Details
#full_description ⇒ Object
Returns the value of attribute full_description.
7 8 9 |
# File 'supply/lib/supply/listing.rb', line 7 def full_description @full_description end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
3 4 5 |
# File 'supply/lib/supply/listing.rb', line 3 def language @language end |
#short_description ⇒ Object
Returns the value of attribute short_description.
6 7 8 |
# File 'supply/lib/supply/listing.rb', line 6 def short_description @short_description end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'supply/lib/supply/listing.rb', line 5 def title @title end |
#video ⇒ Object
Returns the value of attribute video.
8 9 10 |
# File 'supply/lib/supply/listing.rb', line 8 def video @video end |
Instance Method Details
#save ⇒ Object
Updates the listing in the current edit
24 25 26 27 28 29 30 |
# File 'supply/lib/supply/listing.rb', line 24 def save @google_api.update_listing_for_language(language: language, title: title, short_description: short_description, full_description: full_description, video: video) end |