Method: NinjaModel::Attribute#initialize

Defined in:
lib/ninja_model/attribute.rb

#initialize(name, type, options = {}) ⇒ Attribute

Returns a new instance of Attribute.

Raises:



12
13
14
15
16
# File 'lib/ninja_model/attribute.rb', line 12

def initialize(name, type, options = {})
  @name, @type = name.to_s, type
  @default = options[:default]
  raise UnsupportedType.new("Invalid type: #{@type}") unless VALID_TYPES.include?(@type)
end