Class: EPUB::Publication::Package::Guide::Reference

Inherits:
Object
  • Object
show all
Defined in:
lib/epub/publication/package/guide.rb

Constant Summary collapse

TYPES =
%w[cover title-page toc index glossary acknowledgements bibliography colophon copyright-page dedication epigraph foreword loi lot notes preface text]

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#guideObject

Returns the value of attribute guide.



23
24
25
# File 'lib/epub/publication/package/guide.rb', line 23

def guide
  @guide
end

#hrefObject

Returns the value of attribute href.



25
26
27
# File 'lib/epub/publication/package/guide.rb', line 25

def href
  @href
end

#titleObject

Returns the value of attribute title.



23
24
25
# File 'lib/epub/publication/package/guide.rb', line 23

def title
  @title
end

#typeObject

Returns the value of attribute type.



23
24
25
# File 'lib/epub/publication/package/guide.rb', line 23

def type
  @type
end

Instance Method Details

#itemObject



31
32
33
34
35
36
37
38
# File 'lib/epub/publication/package/guide.rb', line 31

def item
  return @item if @item

  request_uri = href.request_uri
  @item = @guide.package.manifest.items.find {|item|
    item.href.request_uri == request_uri
  }
end