class Flextures::LoadFilter

Flextures FactoryFilter is program to translate ActiveRecord data

Constants

FACTORIES

FactoryFilter data

Public Class Methods

[](table_name) click to toggle source
# File lib/flextures/flextures_factory.rb, line 29
def self.[](table_name); self.get(table_name); end
define(table_name, *options, &block) click to toggle source

set FactoryFilter @params [String] table_name @params [Array] options arguments ActiveRecord Model @params [Proc] block FactoryFilter

# File lib/flextures/flextures_factory.rb, line 11
def self.define(table_name, *options, &block)
  h={ block: block }
  options.each do |o|
    begin
      h[:model] = o if o.new.is_a?(ActiveRecord::Base)
    rescue
    end
  end
  FACTORIES[table_name.to_sym]=h
end
get( table_name ) click to toggle source

get FactoryFilter @params [String|Symbol] table_name @return [Proc] filter block

# File lib/flextures/flextures_factory.rb, line 25
def self.get( table_name )
  f = FACTORIES[table_name.to_sym]
  f && f[:block]
end