Class: Pandoku::Format
- Inherits:
-
Object
- Object
- Pandoku::Format
- Defined in:
- lib/pandoku/format.rb
Direct Known Subclasses
Pandoku::Formats::HTML, Pandoku::Formats::Markdown, Pandoku::Formats::ODT, Pandoku::Formats::ReStructuredText
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #cliopts ⇒ Object
-
#initialize(options = {}) ⇒ Format
constructor
A new instance of Format.
Constructor Details
#initialize(options = {}) ⇒ Format
Returns a new instance of Format.
17 18 19 20 21 |
# File 'lib/pandoku/format.rb', line 17 def initialize( = {}) = self.class. keys = .keys .merge!(Hash[.select {|k, v| keys.include?(k) }]) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/pandoku/format.rb', line 6 def end |
Class Method Details
.default_options ⇒ Object
13 14 15 |
# File 'lib/pandoku/format.rb', line 13 def self. {} end |
.name ⇒ Object
8 9 10 11 |
# File 'lib/pandoku/format.rb', line 8 def self.name raise NotImplementedError, 'Format.name should be overrided to return Symbol' end |
Instance Method Details
#cliopts ⇒ Object
23 24 25 26 27 |
# File 'lib/pandoku/format.rb', line 23 def cliopts self..select {|k, v| v } \ .collect {|p| %<--#{p[0].to_s.gsub('_', '-')}> + (p[1] != true ? %<=#{p[1]}> : '') } end |