Class: Coyote::DSL

Inherits:
Object
  • Object
show all
Defined in:
lib/coyote/dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|config| ... } ⇒ DSL

Returns a new instance of DSL.

Yields:

  • (config)


7
8
9
10
11
12
13
14
15
# File 'lib/coyote/dsl.rb', line 7

def initialize(&block)
  config = Struct.new(:input, :output, :options).new
  config.options = {}
  yield config if block_given?
  instance_eval(&block)
  @input = config.input
  @output = config.output
  @options = config.options
end

Instance Attribute Details

#inputObject

Returns the value of attribute input.



5
6
7
# File 'lib/coyote/dsl.rb', line 5

def input
  @input
end

#optionsObject

Returns the value of attribute options.



5
6
7
# File 'lib/coyote/dsl.rb', line 5

def options
  @options
end

#outputObject

Returns the value of attribute output.



5
6
7
# File 'lib/coyote/dsl.rb', line 5

def output
  @output
end

Instance Method Details

#runObject



17
18
19
# File 'lib/coyote/dsl.rb', line 17

def run
  Coyote.compile(@input, @output, @options)            
end