Class: MultiSync::Attributes::Pathname
- Inherits:
-
Virtus::Attribute
- Object
- Virtus::Attribute
- MultiSync::Attributes::Pathname
- Defined in:
- lib/multi_sync/attributes/pathname.rb
Instance Method Summary collapse
- #coerce(value) ⇒ Object
- #coercion_method ⇒ Object
- #primitive ⇒ Object
- #value_coerced?(value) ⇒ Boolean
Instance Method Details
#coerce(value) ⇒ Object
7 8 9 10 |
# File 'lib/multi_sync/attributes/pathname.rb', line 7 def coerce(value) return ::Pathname.new(value) unless value.nil? value end |
#coercion_method ⇒ Object
16 17 18 |
# File 'lib/multi_sync/attributes/pathname.rb', line 16 def coercion_method :to_s end |
#primitive ⇒ Object
20 21 22 |
# File 'lib/multi_sync/attributes/pathname.rb', line 20 def primitive ::Pathname end |
#value_coerced?(value) ⇒ Boolean
12 13 14 |
# File 'lib/multi_sync/attributes/pathname.rb', line 12 def value_coerced?(value) value.is_a?(::Pathname) end |