Module: Servizio::Service::DefineColumnType::InstanceMethods

Defined in:
lib/servizio/service/define_column_type.rb

Instance Method Summary collapse

Instance Method Details

#column_for_attribute(attribute) ⇒ Object



31
32
33
34
35
36
37
38
39
# File 'lib/servizio/service/define_column_type.rb', line 31

def column_for_attribute(attribute)
  if has_attribute?(attribute)
    Struct.new(:limit, :name, :type).new(
      nil,
      attribute,
      send(Servizio::Service::DefineColumnType.column_type_getter_name(attribute))
    )
  end
end

#has_attribute?(attribute) ⇒ Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/servizio/service/define_column_type.rb', line 41

def has_attribute?(attribute)
  respond_to?(Servizio::Service::DefineColumnType.column_type_getter_name(attribute))
end