Class: Sumaki::Model::Fields::Reflection

Inherits:
Object
  • Object
show all
Defined in:
lib/sumaki/model/fields/reflection.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(name, type = nil) ⇒ Reflection

Returns a new instance of Reflection.



9
10
11
12
# File 'lib/sumaki/model/fields/reflection.rb', line 9

def initialize(name, type = nil)
  @name = name
  @type = type
end

Instance Method Details

#nameObject



14
15
16
# File 'lib/sumaki/model/fields/reflection.rb', line 14

def name
  @name.to_sym
end

#type_classObject



18
19
20
# File 'lib/sumaki/model/fields/reflection.rb', line 18

def type_class
  @type_class ||= @type.nil? ? Type::Value : Type.lookup(@type)
end