lib/epubmaker/content.rb in review-1.2.0 vs lib/epubmaker/content.rb in review-1.3.0

- old
+ new

@@ -24,31 +24,39 @@ attr_accessor :title # Header level (from 1) attr_accessor :level # Show in TOC? nil:No. attr_accessor :notoc + # Properties (EPUB3) + attr_accessor :properties + # Chapter type (pre/post/part/nil(body)) + attr_accessor :chaptype # :call-seq: # initialize(file, id, media, title, level, notoc) # initialize(hash) # Construct Content object by passing a sequence of parameters or hash. # Keys of +hash+ relate with each parameters. # +file+ (or +hash+["file"]) is required. Others are optional. - def initialize(fileorhash, id=nil, media=nil, title=nil, level=nil, notoc=nil) + def initialize(fileorhash, id=nil, media=nil, title=nil, level=nil, notoc=nil, properties=nil, chaptype=nil) if fileorhash.instance_of?(Hash) @id = fileorhash["id"] @file = fileorhash["file"] @media = fileorhash["media"] @title = fileorhash["title"] @level = fileorhash["level"] @notoc = fileorhash["notoc"] + @properties = fileorhash["properties"] || [] + @chaptype = fileorhash["chaptype"] else @file = fileorhash @id = id @media = media @title = title @level = level @notoc = notoc + @properties = properties || [] + @chaptype = chaptype end complement end def ==(obj)