Class: ActiveType::VirtualAttributes::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/active_type/virtual_attributes.rb

Instance Method Summary collapse

Constructor Details

#initialize(owner, mod) ⇒ Builder

Returns a new instance of Builder.



49
50
51
52
# File 'lib/active_type/virtual_attributes.rb', line 49

def initialize(owner, mod)
  @owner = owner
  @module = mod
end

Instance Method Details

#build(name, type, options) ⇒ Object



54
55
56
57
58
59
60
61
# File 'lib/active_type/virtual_attributes.rb', line 54

def build(name, type, options)
  validate_attribute_name!(name)
  options.assert_valid_keys(:default)
  add_virtual_column(name, type, options)
  build_reader(name)
  build_writer(name)
  build_dirty_tracking_methods(name)
end