Class: IpwhoApi::Connection

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#asnNumberObject

Returns the value of attribute asnNumber

Returns:

  • (Object)

    the current value of asnNumber



98
99
100
# File 'lib/ipwho.rb', line 98

def asnNumber
  @asnNumber
end

#asnOrgObject

Returns the value of attribute asnOrg

Returns:

  • (Object)

    the current value of asnOrg



98
99
100
# File 'lib/ipwho.rb', line 98

def asnOrg
  @asnOrg
end

#connectionTypeObject

Returns the value of attribute connectionType

Returns:

  • (Object)

    the current value of connectionType



98
99
100
# File 'lib/ipwho.rb', line 98

def connectionType
  @connectionType
end

#domainObject

Returns the value of attribute domain

Returns:

  • (Object)

    the current value of domain



98
99
100
# File 'lib/ipwho.rb', line 98

def domain
  @domain
end

#ispObject

Returns the value of attribute isp

Returns:

  • (Object)

    the current value of isp



98
99
100
# File 'lib/ipwho.rb', line 98

def isp
  @isp
end

#orgObject

Returns the value of attribute org

Returns:

  • (Object)

    the current value of org



98
99
100
# File 'lib/ipwho.rb', line 98

def org
  @org
end

Class Method Details

.from_hash(hash) ⇒ Object



102
103
104
105
106
107
108
109
110
111
# File 'lib/ipwho.rb', line 102

def self.from_hash(hash)
  new(
    asnNumber:      hash["asn_number"],
    asnOrg:         hash["asn_org"],
    isp:            hash["isp"],
    org:            hash["org"],
    domain:         hash["domain"],
    connectionType: hash["connection_type"]
  )
end