Class: Mangos::Book
- Inherits:
-
Object
- Object
- Mangos::Book
- Defined in:
- lib/mangos/book.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#old_key ⇒ Object
Returns the value of attribute old_key.
-
#page_paths ⇒ Object
Returns the value of attribute page_paths.
-
#pages ⇒ Object
Returns the value of attribute pages.
-
#path ⇒ Object
Returns the value of attribute path.
-
#published_on ⇒ Object
Returns the value of attribute published_on.
-
#tags ⇒ Object
Returns the value of attribute tags.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
2 3 4 |
# File 'lib/mangos/book.rb', line 2 def key @key end |
#old_key ⇒ Object
Returns the value of attribute old_key.
2 3 4 |
# File 'lib/mangos/book.rb', line 2 def old_key @old_key end |
#page_paths ⇒ Object
Returns the value of attribute page_paths.
2 3 4 |
# File 'lib/mangos/book.rb', line 2 def page_paths @page_paths end |
#pages ⇒ Object
Returns the value of attribute pages.
2 3 4 |
# File 'lib/mangos/book.rb', line 2 def pages @pages end |
#path ⇒ Object
Returns the value of attribute path.
2 3 4 |
# File 'lib/mangos/book.rb', line 2 def path @path end |
#published_on ⇒ Object
Returns the value of attribute published_on.
2 3 4 |
# File 'lib/mangos/book.rb', line 2 def published_on @published_on end |
#tags ⇒ Object
Returns the value of attribute tags.
2 3 4 |
# File 'lib/mangos/book.rb', line 2 def @tags end |
Class Method Details
.from_hash(hash) ⇒ Object
13 14 15 16 17 |
# File 'lib/mangos/book.rb', line 13 def self.from_hash(hash) book = new book.from_hash(hash) book end |
Instance Method Details
#from_hash(hash) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/mangos/book.rb', line 4 def from_hash(hash) @path = hash["path"] @page_paths = hash["pagePaths"] @pages = hash["pages"] @published_on = hash["publishedOn"] @key = hash["key"] @tags = hash["tags"] end |
#to_hash ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/mangos/book.rb', line 19 def to_hash { "path" => @path, "pagePaths" => @page_paths, "pages" => @pages, "publishedOn" => @published_on, "key" => @key, "tags" => @tags } end |