class Relaxo::Model::Properties::Attribute
Handle conversions for standard datatypes.
Public Class Methods
[](klass, proc = nil)
click to toggle source
# File lib/relaxo/model/properties/attribute.rb, line 34 def self.[](klass, proc = nil) self.new(klass, &proc) end
for_class(klass, &block)
click to toggle source
# File lib/relaxo/model/properties/attribute.rb, line 30 def self.for_class(klass, &block) @@attributes[klass] = Proc.new(&block) end
new(klass, &serialization)
click to toggle source
# File lib/relaxo/model/properties/attribute.rb, line 38 def initialize(klass, &serialization) @klass = klass if block_given? self.instance_eval(&serialization) else self.instance_eval(&@@attributes[klass]) end end