Sha256: 806f45cbfb629dcf42b66e13aa495a9cee5c1b024f1d56183068738f3dec1aac

Contents?: true

Size: 522 Bytes

Versions: 5

Compression:

Stored size: 522 Bytes

Contents

module GoogleTimezone
  class Result
    def initialize(result)
      @result = result
    end

    def raw
      @result
    end

    def success?
      @result['status'].eql?('OK')
    end

    def dst_offset
      @result.fetch('dstOffset',0)
    end

    def raw_offset
      @result.fetch('rawOffset',0)
    end

    def time_zone_id
      @result.fetch('timeZoneId','')
    end

    def time_zone_name
      @result.fetch('timeZoneName','')
    end

    def result
      @result.fetch('result','')
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
google_timezone-0.0.6 lib/google_timezone/result.rb
google_timezone-0.0.5 lib/google_timezone/result.rb
google_timezone-0.0.4 lib/google_timezone/result.rb
google_timezone-0.0.3 lib/google_timezone/result.rb
google_timezone-0.0.1 lib/google_timezone/result.rb