Class: Booky::Layout::Element
- Inherits:
-
Object
- Object
- Booky::Layout::Element
- Defined in:
- lib/booky/layout/element.rb
Direct Known Subclasses
Base::Author, Base::Blockquote, Base::Chart, Base::Charts::Base, Base::Code, Base::Copyright, Base::Footnote, Base::H0, Base::H1, Base::H2, Base::H3, Base::H4, Base::Image, Base::Import, Base::NumberedList, Base::Outline, Base::P, Base::Subtitle, Base::Table, Base::Title, Base::Toc, Base::Tof, Base::UnnumberedList
Instance Attribute Summary collapse
-
#ast ⇒ Object
Returns the value of attribute ast.
-
#document ⇒ Object
Returns the value of attribute document.
-
#index ⇒ Object
Returns the value of attribute index.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options, document, layout, ast = nil, index = nil) ⇒ Element
constructor
A new instance of Element.
- #method_missing(m, *args, &block) ⇒ Object
- #next_option ⇒ Object
- #previous_option ⇒ Object
- #to_prawn ⇒ Object
Constructor Details
#initialize(options, document, layout, ast = nil, index = nil) ⇒ Element
Returns a new instance of Element.
9 10 11 |
# File 'lib/booky/layout/element.rb', line 9 def initialize(, document, layout, ast = nil, index = nil) @options, @document, @layout, @ast, @index = , document, layout, ast, index end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
24 25 26 |
# File 'lib/booky/layout/element.rb', line 24 def method_missing(m, *args, &block) @document.send(m, *args, &block) end |
Instance Attribute Details
#ast ⇒ Object
Returns the value of attribute ast.
5 6 7 |
# File 'lib/booky/layout/element.rb', line 5 def ast @ast end |
#document ⇒ Object
Returns the value of attribute document.
7 8 9 |
# File 'lib/booky/layout/element.rb', line 7 def document @document end |
#index ⇒ Object
Returns the value of attribute index.
6 7 8 |
# File 'lib/booky/layout/element.rb', line 6 def index @index end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/booky/layout/element.rb', line 4 def @options end |
Instance Method Details
#next_option ⇒ Object
20 21 22 |
# File 'lib/booky/layout/element.rb', line 20 def next_option @ast[@index+1] end |
#previous_option ⇒ Object
16 17 18 |
# File 'lib/booky/layout/element.rb', line 16 def previous_option @ast[@index-1] end |
#to_prawn ⇒ Object
13 14 |
# File 'lib/booky/layout/element.rb', line 13 def to_prawn end |