Method: NinjaModel::Attribute#initialize
- Defined in:
- lib/ninja_model/attribute.rb
#initialize(name, type, options = {}) ⇒ Attribute
Returns a new instance of Attribute.
12 13 14 15 16 |
# File 'lib/ninja_model/attribute.rb', line 12 def initialize(name, type, = {}) @name, @type = name.to_s, type @default = [:default] raise UnsupportedType.new("Invalid type: #{@type}") unless VALID_TYPES.include?(@type) end |