Class: IpwhoApi::Timezone

Inherits:
Struct
  • Object
show all
Defined in:
lib/ipwho.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#abbrObject

Returns the value of attribute abbr

Returns:

  • (Object)

    the current value of abbr



61
62
63
# File 'lib/ipwho.rb', line 61

def abbr
  @abbr
end

#currentTimeObject

Returns the value of attribute currentTime

Returns:

  • (Object)

    the current value of currentTime



61
62
63
# File 'lib/ipwho.rb', line 61

def currentTime
  @currentTime
end

#isDstObject

Returns the value of attribute isDst

Returns:

  • (Object)

    the current value of isDst



61
62
63
# File 'lib/ipwho.rb', line 61

def isDst
  @isDst
end

#offsetObject

Returns the value of attribute offset

Returns:

  • (Object)

    the current value of offset



61
62
63
# File 'lib/ipwho.rb', line 61

def offset
  @offset
end

#timeZoneObject

Returns the value of attribute timeZone

Returns:

  • (Object)

    the current value of timeZone



61
62
63
# File 'lib/ipwho.rb', line 61

def timeZone
  @timeZone
end

#utcObject

Returns the value of attribute utc

Returns:

  • (Object)

    the current value of utc



61
62
63
# File 'lib/ipwho.rb', line 61

def utc
  @utc
end

Class Method Details

.from_hash(hash) ⇒ Object



65
66
67
68
69
70
71
72
73
74
# File 'lib/ipwho.rb', line 65

def self.from_hash(hash)
  new(
    timeZone:    hash["time_zone"],
    abbr:        hash["abbr"],
    offset:      hash["offset"],
    isDst:       hash["is_dst"],
    utc:         hash["utc"],
    currentTime: hash["current_time"]
  )
end