Sha256: cefeeab9d2cedb77f1d88cb119f7eb4da09b5021af74c018127b889275259e1e

Contents?: true

Size: 588 Bytes

Versions: 3

Compression:

Stored size: 588 Bytes

Contents

class Mangos::Book
  attr_accessor :path, :page_paths, :pages, :published_on, :old_key, :key, :tags

  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

  def self.from_hash(hash)
    book = new
    book.from_hash(hash)
    book
  end

  def to_hash
    {
      "path" => @path,
      "pagePaths" => @page_paths,
      "pages" => @pages,
      "publishedOn" => @published_on,
      "key" => @key,
      "tags" => @tags
    }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mangos-0.5 lib/mangos/book.rb
mangos-0.4 lib/mangos/book.rb
mangos-0.3 lib/mangos/book.rb