Sha256: 150a826963be2bfd53199741d551f82597f2507655c0c811b6242b25779c13e4
Contents?: true
Size: 774 Bytes
Versions: 6
Compression:
Stored size: 774 Bytes
Contents
module Crudboy class TemplateContext include Helper attr_accessor :model, :columns, :table_name, :model_name, :bundle_options def initialize(definition) @model = definition.model @model_name = definition.model_name @table_name = definition.table_name @columns = @model.columns end def eval(string) instance_eval(format('%%Q{%s}', string), string, 0) end def binding Kernel::binding end def columns(**options) model.columns(**options) end 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 end end
Version data entries
6 entries across 6 versions & 1 rubygems