Class: ReadingList::Book

Inherits:
Object
  • Object
show all
Defined in:
lib/reading_list/models/book.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#authorObject (readonly)

Returns the value of attribute author.



11
12
13
# File 'lib/reading_list/models/book.rb', line 11

def author
  @author
end

Returns the value of attribute link.



11
12
13
# File 'lib/reading_list/models/book.rb', line 11

def link
  @link
end

#titleObject (readonly)

Returns the value of attribute title.



11
12
13
# File 'lib/reading_list/models/book.rb', line 11

def title
  @title
end

#yearObject (readonly)

Returns the value of attribute year.



11
12
13
# File 'lib/reading_list/models/book.rb', line 11

def year
  @year
end