Class: MultiSync::Attributes::Pathname

Inherits:
Virtus::Attribute
  • Object
show all
Defined in:
lib/multi_sync/attributes/pathname.rb

Instance Method Summary collapse

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_methodObject



16
17
18
# File 'lib/multi_sync/attributes/pathname.rb', line 16

def coercion_method
  :to_s
end

#primitiveObject



20
21
22
# File 'lib/multi_sync/attributes/pathname.rb', line 20

def primitive
  ::Pathname
end

#value_coerced?(value) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/multi_sync/attributes/pathname.rb', line 12

def value_coerced?(value)
  value.is_a?(::Pathname)
end