Class: Threatstack::Response
- Inherits:
-
Object
- Object
- Threatstack::Response
show all
- Includes:
- Serializable
- Defined in:
- lib/threatstack/response.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#attrs, #camelize, included, #initialize, #method_missing
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Threatstack::Serializable
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
12
13
14
|
# File 'lib/threatstack/response.rb', line 12
def client
@client
end
|
#entity ⇒ Object
Returns the value of attribute entity.
12
13
14
|
# File 'lib/threatstack/response.rb', line 12
def entity
@entity
end
|
#raw ⇒ Object
Returns the value of attribute raw.
12
13
14
|
# File 'lib/threatstack/response.rb', line 12
def raw
@raw
end
|
Instance Method Details
#agents ⇒ Object
15
16
17
18
|
# File 'lib/threatstack/response.rb', line 15
def agents
raise InvalidEntity unless entity == :agent
raw.map{ |a| Agent.new(a, client) }
end
|
#alerts ⇒ Object
20
21
22
23
|
# File 'lib/threatstack/response.rb', line 20
def alerts
raise InvalidEntity unless entity == :alert
raw.map{ |a| Alert.new(a, client) }
end
|
#cves ⇒ Object
25
26
27
28
|
# File 'lib/threatstack/response.rb', line 25
def cves
raise InvalidEntity unless entity == :cve
raw.map{ |a| Cve.new(a, client) }
end
|
#list ⇒ Object
40
41
42
|
# File 'lib/threatstack/response.rb', line 40
def list
raw.map { |g| GenericObject.new(g, client) }
end
|
#rules ⇒ Object
35
36
37
38
|
# File 'lib/threatstack/response.rb', line 35
def rules
raise InvalidEntity unless entity == :rule
raw.map{ |r| Rule.new(r, client) }
end
|
#rulesets ⇒ Object
30
31
32
33
|
# File 'lib/threatstack/response.rb', line 30
def rulesets
raise InvalidEntity unless entity == :ruleset
raw.map{ |r| Ruleset.new(r, client) }
end
|