Sha256: 3160304efde15800cf6a5e30672ccce398fd7649af84c5b096293c9fc163bc0b
Contents?: true
Size: 627 Bytes
Versions: 336
Compression:
Stored size: 627 Bytes
Contents
module Avo module Loaders class FieldsLoader < Loader def add_field(field) @bag.push field end def method_missing(method, *args, &block) matched_field = Avo::App.fields.find do |field| field[:name].to_s == method.to_s end if matched_field.present? && matched_field[:class].present? klass = matched_field[:class] field = if block.present? klass.new(args[0], **args[1] || {}, &block) else klass.new(args[0], **args[1] || {}) end add_field field end end end end end
Version data entries
336 entries across 336 versions & 1 rubygems