Class: Sumaki::Model::Fields::Reflection
- Inherits:
-
Object
- Object
- Sumaki::Model::Fields::Reflection
- Defined in:
- lib/sumaki/model/fields/reflection.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(name, type = nil) ⇒ Reflection
constructor
A new instance of Reflection.
- #name ⇒ Object
- #type_class ⇒ Object
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
#name ⇒ Object
14 15 16 |
# File 'lib/sumaki/model/fields/reflection.rb', line 14 def name @name.to_sym end |
#type_class ⇒ Object
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 |