class Relaxo::Model::Properties::Optional
Public Class Methods
[](klass)
click to toggle source
# File lib/relaxo/model/properties/attribute.rb, line 70 def self.[] klass self.new(klass) end
new(klass)
click to toggle source
# File lib/relaxo/model/properties/attribute.rb, line 74 def initialize(klass) @klass = klass end
Public Instance Methods
blank?(value)
click to toggle source
# File lib/relaxo/model/properties/attribute.rb, line 78 def blank?(value) if value.nil? return true end if value.respond_to?(:empty?) && value.empty? return true end return false end
convert_from_primative(dataset, value)
click to toggle source
# File lib/relaxo/model/properties/attribute.rb, line 98 def convert_from_primative(dataset, value) if blank?(value) nil else @klass.convert_from_primative(dataset, value) end end
convert_to_primative(value)
click to toggle source
# File lib/relaxo/model/properties/attribute.rb, line 90 def convert_to_primative(value) if blank?(value) nil else @klass.convert_to_primative(value) end end