Completed
Pull Request — master (#14)
by Marcelo
40s
created

Time   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
c 3
b 0
f 0
dl 0
loc 10
rs 10
1
require 'time'
2
3
module Koine
4
  module Attributes
5
    module Adapter
6
      class Time < Base
7
        private
8
9
        def coerce_not_nil(value)
10
          secure do
11
            next value if value.is_a?(::Time)
12
            ::Time.parse(value)
13
          rescue StandardError => error
0 ignored issues
show
Bug introduced by
The Ruby parser could not interpret the code. It reported: unexpected token kRESCUE (Using Ruby 2.0 ...meter, under `AllCops`).
Loading history...
14
            raise ArgumentError, error
15
          end
16
        end
17
      end
18
    end
19
  end
20
end
21