Class: Paggio::Script

Inherits:
Object
  • Object
show all
Defined in:
lib/paggio/script.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}, &block) ⇒ Script

Returns a new instance of Script.



17
18
19
20
# File 'lib/paggio/script.rb', line 17

def initialize(options = {}, &block)
  @options = options
  @block   = block
end

Instance Method Details

#buildObject



22
23
24
25
# File 'lib/paggio/script.rb', line 22

def build
  Opal.compile(@block.to_source['proc { '.length .. -' }'.length],
    @options)
end