Class: OneRuby::Quote
- Inherits:
-
Object
- Object
- OneRuby::Quote
- Defined in:
- lib/one_ruby/quote.rb
Instance Attribute Summary collapse
-
#character_id ⇒ Object
Returns the value of attribute character_id.
-
#dialog ⇒ Object
Returns the value of attribute dialog.
-
#id ⇒ Object
Returns the value of attribute id.
-
#movie_id ⇒ Object
Returns the value of attribute movie_id.
Class Method Summary collapse
Instance Attribute Details
#character_id ⇒ Object
Returns the value of attribute character_id.
3 4 5 |
# File 'lib/one_ruby/quote.rb', line 3 def character_id @character_id end |
#dialog ⇒ Object
Returns the value of attribute dialog.
3 4 5 |
# File 'lib/one_ruby/quote.rb', line 3 def dialog @dialog end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/one_ruby/quote.rb', line 3 def id @id end |
#movie_id ⇒ Object
Returns the value of attribute movie_id.
3 4 5 |
# File 'lib/one_ruby/quote.rb', line 3 def movie_id @movie_id end |
Class Method Details
.list(movie_id) ⇒ Object
5 6 7 8 9 |
# File 'lib/one_ruby/quote.rb', line 5 def self.list(movie_id) results = OneRuby::Client.get "movie/#{movie_id}/quote" quotes = results['docs'] quotes.map { |r| transform(r) } end |
.transform(response) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/one_ruby/quote.rb', line 11 def self.transform(response) quote = Quote.new quote.id = response['_id'] quote.dialog = response['dialog'] quote.movie_id = response['movie'] quote.character_id = response['character'] quote end |