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


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

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


26
27
28
29
30
31
32
33
# File 'lib/epub/publication/package/guide.rb', line 26

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