class ErbSqlTemplates::TemplateScope

Public Class Methods

new(builder, hash) click to toggle source
Calls superclass method
# File lib/erb_sql_templates.rb, line 56
def initialize(builder, hash)
  @builder = builder
  super hash
end

Public Instance Methods

get_binding() click to toggle source

Expose private binding() method.

# File lib/erb_sql_templates.rb, line 71
def get_binding
  binding()
end
h(value) click to toggle source

helper for sanitizing sql inputs

# File lib/erb_sql_templates.rb, line 66
def h(value)
  return @builder.connection.quote(value)
end
method_missing(prop, *args) click to toggle source

Raise exeption if you try to use a property that does not exist.

Calls superclass method
# File lib/erb_sql_templates.rb, line 76
def method_missing(prop, *args)
  if prop.to_s.include?('=') || (@table != nil && (@table.has_key?(prop) || self.respond_to?(prop))  )
    super
  else
    raise NoMethodError, "No property `#{prop}` set for this SQL.", caller(1)
  end
end
render(template_name, **args) click to toggle source
# File lib/erb_sql_templates.rb, line 61
def render(template_name, **args)
  return @builder.render(template_name, **args)
end