Class: IpwhoApi::UserAgent
- Inherits:
-
Struct
- Object
- Struct
- IpwhoApi::UserAgent
- Defined in:
- lib/ipwho.rb
Instance Attribute Summary collapse
-
#browser ⇒ Object
Returns the value of attribute browser.
-
#cpu ⇒ Object
Returns the value of attribute cpu.
-
#device ⇒ Object
Returns the value of attribute device.
-
#engine ⇒ Object
Returns the value of attribute engine.
-
#os ⇒ Object
Returns the value of attribute os.
Class Method Summary collapse
Instance Attribute Details
#browser ⇒ Object
Returns the value of attribute browser
154 155 156 |
# File 'lib/ipwho.rb', line 154 def browser @browser end |
#cpu ⇒ Object
Returns the value of attribute cpu
154 155 156 |
# File 'lib/ipwho.rb', line 154 def cpu @cpu end |
#device ⇒ Object
Returns the value of attribute device
154 155 156 |
# File 'lib/ipwho.rb', line 154 def device @device end |
#engine ⇒ Object
Returns the value of attribute engine
154 155 156 |
# File 'lib/ipwho.rb', line 154 def engine @engine end |
#os ⇒ Object
Returns the value of attribute os
154 155 156 |
# File 'lib/ipwho.rb', line 154 def os @os end |
Class Method Details
.from_hash(hash) ⇒ Object
155 156 157 158 159 160 161 162 163 |
# File 'lib/ipwho.rb', line 155 def self.from_hash(hash) new( browser: hash["browser"] ? UserAgentBrowser.from_hash(hash["browser"]) : nil, engine: hash["engine"] ? UserAgentEngine.from_hash(hash["engine"]) : nil, os: hash["os"] ? UserAgentOS.from_hash(hash["os"]) : nil, device: hash["device"] ? UserAgentDevice.from_hash(hash["device"]) : nil, cpu: hash["cpu"] ? UserAgentCPU.from_hash(hash["cpu"]) : nil ) end |