Class: Remarkably::Engines::HTML

Inherits:
XML show all
Defined in:
lib/remarkably/engines/html.rb

Instance Method Summary collapse

Methods inherited from XML

#method!, #text

Methods inherited from Base::Engine

#clear!, #method!, #method_missing, #missing_method, #to_s

Constructor Details

#initializeHTML

Returns a new instance of HTML.



8
9
10
11
# File 'lib/remarkably/engines/html.rb', line 8

def initialize
  super
  @css_engine = Engines::CSS.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Remarkably::Base::Engine

Instance Method Details

#style(args, hash, &block) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/remarkably/engines/html.rb', line 12

def style args, hash, &block
  if block_given?
    @css_engine.clear!
    @context.remarkably_engine = @css_engine
    block.call
    @context.remarkably_engine = self
    args = ["\n#{@css_engine}"]+args
  end
  method!( :style, args, hash )
end