Class: Bookit::Emitter::Abstract
- Inherits:
-
Object
- Object
- Bookit::Emitter::Abstract
- Defined in:
- lib/bookit/emitter/base.rb,
lib/bookit/emitter/abstract.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ font_size: 12, header_size: 20, header_style: :bold, subtitle_size: 10, subtitle_style: :italic }
Instance Attribute Summary collapse
-
#article ⇒ Object
Returns the value of attribute article.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(article, options = {}) ⇒ Abstract
constructor
A new instance of Abstract.
Constructor Details
#initialize(article, options = {}) ⇒ Abstract
Returns a new instance of Abstract.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/bookit/emitter/base.rb', line 16 def initialize(article, ={}) @article = article @options = DEFAULT_OPTIONS.merge() # have all our type renderers raise an error unless defined in the subclass. Bookit::Content::TYPES.each do |type| define_method "render_#{type}".to_sym do raise_abstract end end end |
Instance Attribute Details
#article ⇒ Object
Returns the value of attribute article.
4 5 6 |
# File 'lib/bookit/emitter/base.rb', line 4 def article @article end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/bookit/emitter/base.rb', line 4 def @options end |