Class: Compel::Coercion::Type
- Inherits:
-
Object
- Object
- Compel::Coercion::Type
- Defined in:
- lib/compel/coercion/types/type.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
- #coerce ⇒ Object
-
#initialize(value, options = {}) ⇒ Type
constructor
A new instance of Type.
Constructor Details
#initialize(value, options = {}) ⇒ Type
Returns a new instance of Type.
13 14 15 16 |
# File 'lib/compel/coercion/types/type.rb', line 13 def initialize(value, = {}) @value = value @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/compel/coercion/types/type.rb', line 6 def @options end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/compel/coercion/types/type.rb', line 6 def value @value end |
Class Method Details
.coerce(value, options = {}) ⇒ Object
9 10 11 |
# File 'lib/compel/coercion/types/type.rb', line 9 def self.coerce(value, = {}) new(value, ).coerce end |
.human_name ⇒ Object
32 33 34 |
# File 'lib/compel/coercion/types/type.rb', line 32 def human_name "#{self.name.split('::')[-1]}" end |