Completed
Push — master ( 681fa7...7087b8 )
by Marcelo
01:12
created

Time.coerce()   A

Complexity

Conditions 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
1
module Koine
2
  module Attributes
3
    module Adapter
4
      class Time < Base
5
        def coerce(value)
6
          secure do
7
            next value if value.is_a?(::Time)
8
            ::Time.parse(value)
9
          end
10
        end
11
      end
12
    end
13
  end
14
end
15