Class: ReadingList::Book
- Inherits:
-
Object
- Object
- ReadingList::Book
- Defined in:
- lib/reading_list/models/book.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(json_hash) ⇒ Book
constructor
A new instance of Book.
Constructor Details
#initialize(json_hash) ⇒ Book
Returns a new instance of Book.
3 4 5 6 7 8 9 |
# File 'lib/reading_list/models/book.rb', line 3 def initialize(json_hash) @author = json_hash[:author] @title = json_hash[:title] @year = json_hash[:year] @link = json_hash[:link] end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
11 12 13 |
# File 'lib/reading_list/models/book.rb', line 11 def @author end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
11 12 13 |
# File 'lib/reading_list/models/book.rb', line 11 def link @link end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
11 12 13 |
# File 'lib/reading_list/models/book.rb', line 11 def title @title end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
11 12 13 |
# File 'lib/reading_list/models/book.rb', line 11 def year @year end |