class Motley::AttDef::Scalar

Motley::AttDef::Scalar

Constants

ALLOWED

Public Instance Methods

allowed_class(val) click to toggle source
# File lib/motley.rb, line 156
def allowed_class(val)
        # loop through allowed classes
        ALLOWED.each do |allowed|
                if val.is_a?(allowed)
                        return true
                end
        end
        
        # raise exception
        raise 'zax/attdef/scalar/allowed-class: ' + ALLOWED.to_s
end
set(val) click to toggle source
# File lib/motley.rb, line 144
def set(val)
        allowed_class(val)
        return val
end
to_str(val) click to toggle source
# File lib/motley.rb, line 175
def to_str(val)
        return val.to_s
end