Class: Timezone

Inherits:
Object
  • Object
show all
Defined in:
lib/ipgeolocation_io/Timezone.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Timezone

Returns a new instance of Timezone.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/ipgeolocation_io/Timezone.rb', line 23

def initialize(json)
  @status = json["status"].to_i;
  if @status != 200 || json["message"] != nil
    @message = json["message"].to_s;
  else
    @timezone = json["timezone"];
    @timezoneOffset = json["timezone_offset"];
    @date = json["date"];
    @dateTime = json["date_time"];
    @dateTimeTxt = json["date_time_txt"];
    @dateTimeWti = json["date_time_wti"];
    @dateTimeYmd = json["date_time_ymd"];
    @dateTimeUnix = json["date_time_unix"];
    @time24 = json["time_24"];
    @time12 = json["time_12"];
    @week = json["week"];
    @month = json["month"];
    @year = json["year"];
    @yearAbbr = json["year_abbr"];
    @isDST = json["is_dst"];
    @dstSavings = json["dst_savings"];
    if json["geo"] != nil
      @timezoneGeo = TimezoneGeo.new(json["geo"]);
    end
  end
end

Instance Attribute Details

#dateObject (readonly)

Returns the value of attribute date.



7
8
9
# File 'lib/ipgeolocation_io/Timezone.rb', line 7

def date
  @date
end

#dateTimeObject (readonly)

Returns the value of attribute dateTime.



8
9
10
# File 'lib/ipgeolocation_io/Timezone.rb', line 8

def dateTime
  @dateTime
end

#dateTimeTxtObject (readonly)

Returns the value of attribute dateTimeTxt.



9
10
11
# File 'lib/ipgeolocation_io/Timezone.rb', line 9

def dateTimeTxt
  @dateTimeTxt
end

#dateTimeUnixObject (readonly)

Returns the value of attribute dateTimeUnix.



12
13
14
# File 'lib/ipgeolocation_io/Timezone.rb', line 12

def dateTimeUnix
  @dateTimeUnix
end

#dateTimeWtiObject (readonly)

Returns the value of attribute dateTimeWti.



10
11
12
# File 'lib/ipgeolocation_io/Timezone.rb', line 10

def dateTimeWti
  @dateTimeWti
end

#dateTimeYmdObject (readonly)

Returns the value of attribute dateTimeYmd.



11
12
13
# File 'lib/ipgeolocation_io/Timezone.rb', line 11

def dateTimeYmd
  @dateTimeYmd
end

#dstSavingsObject (readonly)

Returns the value of attribute dstSavings.



20
21
22
# File 'lib/ipgeolocation_io/Timezone.rb', line 20

def dstSavings
  @dstSavings
end

#isDSTObject (readonly)

Returns the value of attribute isDST.



19
20
21
# File 'lib/ipgeolocation_io/Timezone.rb', line 19

def isDST
  @isDST
end

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'lib/ipgeolocation_io/Timezone.rb', line 4

def message
  @message
end

#monthObject (readonly)

Returns the value of attribute month.



16
17
18
# File 'lib/ipgeolocation_io/Timezone.rb', line 16

def month
  @month
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/ipgeolocation_io/Timezone.rb', line 3

def status
  @status
end

#time12Object (readonly)

Returns the value of attribute time12.



14
15
16
# File 'lib/ipgeolocation_io/Timezone.rb', line 14

def time12
  @time12
end

#time24Object (readonly)

Returns the value of attribute time24.



13
14
15
# File 'lib/ipgeolocation_io/Timezone.rb', line 13

def time24
  @time24
end

#timezoneObject (readonly)

Returns the value of attribute timezone.



5
6
7
# File 'lib/ipgeolocation_io/Timezone.rb', line 5

def timezone
  @timezone
end

#timezoneGeoObject (readonly)

Returns the value of attribute timezoneGeo.



21
22
23
# File 'lib/ipgeolocation_io/Timezone.rb', line 21

def timezoneGeo
  @timezoneGeo
end

#timezoneOffsetObject (readonly)

Returns the value of attribute timezoneOffset.



6
7
8
# File 'lib/ipgeolocation_io/Timezone.rb', line 6

def timezoneOffset
  @timezoneOffset
end

#weekObject (readonly)

Returns the value of attribute week.



15
16
17
# File 'lib/ipgeolocation_io/Timezone.rb', line 15

def week
  @week
end

#yearObject (readonly)

Returns the value of attribute year.



17
18
19
# File 'lib/ipgeolocation_io/Timezone.rb', line 17

def year
  @year
end

#yearAbbrObject (readonly)

Returns the value of attribute yearAbbr.



18
19
20
# File 'lib/ipgeolocation_io/Timezone.rb', line 18

def yearAbbr
  @yearAbbr
end