Class: ActiveType::VirtualAttributes::Builder
- Inherits:
-
Object
- Object
- ActiveType::VirtualAttributes::Builder
- Defined in:
- lib/active_type/virtual_attributes.rb
Instance Method Summary collapse
- #build(name, type, options) ⇒ Object
-
#initialize(owner, mod) ⇒ Builder
constructor
A new instance of Builder.
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 62 |
# File 'lib/active_type/virtual_attributes.rb', line 54 def build(name, type, ) validate_attribute_name!(name) .assert_valid_keys(:default) deprecate_non_frozen_defaults([:default], name) add_virtual_column(name, type, ) build_reader(name) build_writer(name) build_dirty_tracking_methods(name) end |