Class: RiceBubble::Attributes::Time

Inherits:
Base
  • Object
show all
Defined in:
lib/rice_bubble/attributes/time.rb

Instance Method Summary collapse

Methods inherited from Base

#call, #description, #fetch, #initialize, #optional, #valid_types

Constructor Details

This class inherits a constructor from RiceBubble::Attributes::Base

Instance Method Details

#coerce(value) ⇒ Object



10
11
12
13
14
# File 'lib/rice_bubble/attributes/time.rb', line 10

def coerce(value)
  return nil unless valid_time?(value)

  value
end

#valid?(value) ⇒ Boolean

Returns:



4
5
6
7
8
# File 'lib/rice_bubble/attributes/time.rb', line 4

def valid?(value)
  return false unless valid_time?(value)

  value.respond_to?(:to_time)
end