class Crudboy::TemplateContext

Attributes

bundle_options[RW]
columns[RW]
model[RW]
model_name[RW]
table_name[RW]

Public Class Methods

new(definition) click to toggle source
# File lib/crudboy/template_context.rb, line 8
def initialize(definition)
  @model = definition.model
  @model_name = definition.model_name
  @table_name = definition.table_name
  @columns = @model.columns
end

Public Instance Methods

binding() click to toggle source
# File lib/crudboy/template_context.rb, line 19
def binding
  Kernel::binding
end
eval(string) click to toggle source
# File lib/crudboy/template_context.rb, line 15
def eval(string)
  instance_eval(format('%%Q{%s}', string), string, 0)
end
method_missing(method, *args, **options, &block) click to toggle source
Calls superclass method
# File lib/crudboy/template_context.rb, line 27
def method_missing(method, *args, **options, &block)
  if args.empty? && options.empty? && block.nil? && bundle_options.table.keys.include?(method)
    bundle_options.send(method)
  else
    super
  end
end