Class: Masklen::Privacy
- Inherits:
-
Struct
- Object
- Struct
- Masklen::Privacy
- Defined in:
- lib/masklen/types.rb
Overview
Privacy and threat indicators for an IP address.
threat_level is “low” or “medium”.
Instance Attribute Summary collapse
-
#hosting ⇒ Object
Returns the value of attribute hosting.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
-
#threat_level ⇒ Object
Returns the value of attribute threat_level.
-
#tor ⇒ Object
Returns the value of attribute tor.
-
#vpn ⇒ Object
Returns the value of attribute vpn.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Build a Privacy from a parsed JSON hash.
Instance Attribute Details
#hosting ⇒ Object
Returns the value of attribute hosting
55 56 57 |
# File 'lib/masklen/types.rb', line 55 def hosting @hosting end |
#proxy ⇒ Object
Returns the value of attribute proxy
55 56 57 |
# File 'lib/masklen/types.rb', line 55 def proxy @proxy end |
#threat_level ⇒ Object
Returns the value of attribute threat_level
55 56 57 |
# File 'lib/masklen/types.rb', line 55 def threat_level @threat_level end |
#tor ⇒ Object
Returns the value of attribute tor
55 56 57 |
# File 'lib/masklen/types.rb', line 55 def tor @tor end |
#vpn ⇒ Object
Returns the value of attribute vpn
55 56 57 |
# File 'lib/masklen/types.rb', line 55 def vpn @vpn end |
Class Method Details
.from_hash(hash) ⇒ Object
Build a Privacy from a parsed JSON hash. Returns nil if hash is nil.
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/masklen/types.rb', line 64 def self.from_hash(hash) return nil if hash.nil? new( vpn: hash["vpn"], proxy: hash["proxy"], tor: hash["tor"], hosting: hash["hosting"], threat_level: hash["threat_level"] ) end |