Class: Timezone
- Inherits:
-
Object
- Object
- Timezone
- Defined in:
- lib/ipgeolocation_io/Timezone.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#dateTime ⇒ Object
readonly
Returns the value of attribute dateTime.
-
#dateTimeTxt ⇒ Object
readonly
Returns the value of attribute dateTimeTxt.
-
#dateTimeUnix ⇒ Object
readonly
Returns the value of attribute dateTimeUnix.
-
#dateTimeWti ⇒ Object
readonly
Returns the value of attribute dateTimeWti.
-
#dateTimeYmd ⇒ Object
readonly
Returns the value of attribute dateTimeYmd.
-
#dstSavings ⇒ Object
readonly
Returns the value of attribute dstSavings.
-
#isDST ⇒ Object
readonly
Returns the value of attribute isDST.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#month ⇒ Object
readonly
Returns the value of attribute month.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#time12 ⇒ Object
readonly
Returns the value of attribute time12.
-
#time24 ⇒ Object
readonly
Returns the value of attribute time24.
-
#timezone ⇒ Object
readonly
Returns the value of attribute timezone.
-
#timezoneGeo ⇒ Object
readonly
Returns the value of attribute timezoneGeo.
-
#timezoneOffset ⇒ Object
readonly
Returns the value of attribute timezoneOffset.
-
#week ⇒ Object
readonly
Returns the value of attribute week.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
-
#yearAbbr ⇒ Object
readonly
Returns the value of attribute yearAbbr.
Instance Method Summary collapse
-
#initialize(json) ⇒ Timezone
constructor
A new instance of Timezone.
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 = 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
#date ⇒ Object (readonly)
Returns the value of attribute date.
7 8 9 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 7 def date @date end |
#dateTime ⇒ Object (readonly)
Returns the value of attribute dateTime.
8 9 10 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 8 def dateTime @dateTime end |
#dateTimeTxt ⇒ Object (readonly)
Returns the value of attribute dateTimeTxt.
9 10 11 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 9 def dateTimeTxt @dateTimeTxt end |
#dateTimeUnix ⇒ Object (readonly)
Returns the value of attribute dateTimeUnix.
12 13 14 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 12 def dateTimeUnix @dateTimeUnix end |
#dateTimeWti ⇒ Object (readonly)
Returns the value of attribute dateTimeWti.
10 11 12 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 10 def dateTimeWti @dateTimeWti end |
#dateTimeYmd ⇒ Object (readonly)
Returns the value of attribute dateTimeYmd.
11 12 13 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 11 def dateTimeYmd @dateTimeYmd end |
#dstSavings ⇒ Object (readonly)
Returns the value of attribute dstSavings.
20 21 22 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 20 def dstSavings @dstSavings end |
#isDST ⇒ Object (readonly)
Returns the value of attribute isDST.
19 20 21 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 19 def isDST @isDST end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 4 def end |
#month ⇒ Object (readonly)
Returns the value of attribute month.
16 17 18 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 16 def month @month end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 3 def status @status end |
#time12 ⇒ Object (readonly)
Returns the value of attribute time12.
14 15 16 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 14 def time12 @time12 end |
#time24 ⇒ Object (readonly)
Returns the value of attribute time24.
13 14 15 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 13 def time24 @time24 end |
#timezone ⇒ Object (readonly)
Returns the value of attribute timezone.
5 6 7 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 5 def timezone @timezone end |
#timezoneGeo ⇒ Object (readonly)
Returns the value of attribute timezoneGeo.
21 22 23 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 21 def timezoneGeo @timezoneGeo end |
#timezoneOffset ⇒ Object (readonly)
Returns the value of attribute timezoneOffset.
6 7 8 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 6 def timezoneOffset @timezoneOffset end |
#week ⇒ Object (readonly)
Returns the value of attribute week.
15 16 17 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 15 def week @week end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
17 18 19 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 17 def year @year end |
#yearAbbr ⇒ Object (readonly)
Returns the value of attribute yearAbbr.
18 19 20 |
# File 'lib/ipgeolocation_io/Timezone.rb', line 18 def yearAbbr @yearAbbr end |