Class: Parameters::Types::Class
- Defined in:
- lib/parameters/types/class.rb
Instance Attribute Summary collapse
-
#base_class ⇒ Object
readonly
The base-class of the Class Type.
Instance Method Summary collapse
-
#coerce(value) ⇒ Object
Coerces a value into an instance of the Class.
-
#initialize(base_class) ⇒ Class
constructor
Initializes the Class Type.
-
#to_ruby ⇒ Class
The Ruby Class the type represents.
Methods inherited from Object
Methods inherited from Type
#<, #<=, #==, ===, #===, coerce, to_ruby
Constructor Details
#initialize(base_class) ⇒ Class
Initializes the Class Type.
16 17 18 |
# File 'lib/parameters/types/class.rb', line 16 def initialize(base_class) @base_class = base_class end |
Instance Attribute Details
#base_class ⇒ Object (readonly)
The base-class of the Class Type
8 9 10 |
# File 'lib/parameters/types/class.rb', line 8 def base_class @base_class end |
Instance Method Details
#coerce(value) ⇒ Object
Coerces a value into an instance of the Class.
39 40 41 |
# File 'lib/parameters/types/class.rb', line 39 def coerce(value) @base_class.new(value) end |
#to_ruby ⇒ Class
The Ruby Class the type represents.
26 27 28 |
# File 'lib/parameters/types/class.rb', line 26 def to_ruby @base_class end |