Class: Aspen::Actions::Compile

Inherits:
Object
  • Object
show all
Defined in:
lib/aspen/actions/compile.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, options = {}) ⇒ Compile

Returns a new instance of Compile.



7
8
9
10
11
12
13
# File 'lib/aspen/actions/compile.rb', line 7

def initialize(path, options = {})
  @path = path
  @basename = File.basename(@path, ".aspen")
  dir       = File.dirname(@path)
  @dest     = File.expand_path("#{@basename}.cql", dir)
  @options  = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/aspen/actions/compile.rb', line 5

def options
  @options
end

Instance Method Details

#callObject



15
16
17
18
# File 'lib/aspen/actions/compile.rb', line 15

def call
  compile_to_file
  send_to_database if options.fetch(:database, false)
end