Class: Safrano::AttributeTypeMapping

Inherits:
TypeMapping show all
Defined in:
lib/safrano/type_mapping.rb

Overview

Model attribute (column) specific mapping

Defined Under Namespace

Classes: Builder

Instance Attribute Summary collapse

Attributes inherited from TypeMapping

#castfunc, #edm_type

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(builder) ⇒ AttributeTypeMapping

Returns a new instance of AttributeTypeMapping.



20
21
22
23
# File 'lib/safrano/type_mapping.rb', line 20

def initialize(builder)
  @edm_type = builder.xedm_type
  @castfunc = builder.castfunc
end

Instance Attribute Details

#attr_nameObject (readonly)

Returns the value of attribute attr_name.



18
19
20
# File 'lib/safrano/type_mapping.rb', line 18

def attr_name
  @attr_name
end

Class Method Details

.builder(atnam, &proc) ⇒ Object



44
45
46
47
48
# File 'lib/safrano/type_mapping.rb', line 44

def self.builder(atnam, &proc)
  builder = Builder.new(atnam)
  builder.instance_eval(&proc)
  builder
end