class ArDocStore::Attributes::Base

Attributes

attribute[RW]
conversion[RW]
default[RW]
model[RW]
options[RW]
predicate[RW]

Public Class Methods

build(model, attribute, options={}) click to toggle source
# File lib/ar_doc_store/attributes/base.rb, line 13
def self.build(model, attribute, options={})
  new(model, attribute, options).build
end
new(model, attribute, options) click to toggle source
# File lib/ar_doc_store/attributes/base.rb, line 17
def initialize(model, attribute, options)
  @model, @attribute, @options = model, attribute, options
  @default = options.delete(:default)
end

Public Instance Methods

build() click to toggle source
# File lib/ar_doc_store/attributes/base.rb, line 22
def build
  run_callbacks :build do
    store_attribute
  end
  self
end