Class: Contentful::BaseCoercion
- Inherits:
-
Object
- Object
- Contentful::BaseCoercion
- Defined in:
- lib/contentful/coercions.rb
Overview
Basic Coercion
Direct Known Subclasses
ArrayCoercion, BooleanCoercion, DateCoercion, FloatCoercion, IntegerCoercion, LinkCoercion, LocationCoercion, ObjectCoercion, RichTextCoercion, StringCoercion
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#coerce ⇒ Object
Coerces value.
-
#initialize(value, options = {}) ⇒ BaseCoercion
constructor
A new instance of BaseCoercion.
Constructor Details
#initialize(value, options = {}) ⇒ BaseCoercion
Returns a new instance of BaseCoercion.
8 9 10 11 |
# File 'lib/contentful/coercions.rb', line 8 def initialize(value, = {}) @value = value @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/contentful/coercions.rb', line 7 def @options end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/contentful/coercions.rb', line 7 def value @value end |
Instance Method Details
#coerce ⇒ Object
Coerces value
14 15 16 |
# File 'lib/contentful/coercions.rb', line 14 def coerce(*) value end |