Class: Liquigen::Handlers::Sql

Inherits:
Base
  • Object
show all
Defined in:
lib/liquigen/handlers/sql.rb

Instance Attribute Summary

Attributes inherited from Base

#id, #props, #sets, #table

Instance Method Summary collapse

Methods inherited from Base

#process

Constructor Details

#initialize(props) ⇒ Sql

Returns a new instance of Sql.



5
6
7
8
9
# File 'lib/liquigen/handlers/sql.rb', line 5

def initialize(props)
  self.props = props
  self.sets = []
  self.id = build_id
end

Instance Method Details

#action_nameObject



11
12
13
# File 'lib/liquigen/handlers/sql.rb', line 11

def action_name
  'sql'
end

#build_one_changeset(set) ⇒ Object



19
20
21
22
# File 'lib/liquigen/handlers/sql.rb', line 19

def build_one_changeset(set)
  change = Liquigen::Sql.new '# write your sql here, and you can remove the quote outside.'
  set.changes << change
end

#file_suffixObject



15
16
17
# File 'lib/liquigen/handlers/sql.rb', line 15

def file_suffix
  props.map(&:underscore).join('_')
end