Class: Stoolie::Result
- Inherits:
-
Object
- Object
- Stoolie::Result
- Defined in:
- lib/stoolie/result.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#input ⇒ Object
Returns the value of attribute input.
-
#output ⇒ Object
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize(client) ⇒ Result
constructor
Client must have the following attributes:.
-
#is_blacklisted? ⇒ Boolean
Public: tells whether the client found blacklisted phrases.
-
#is_insecure? ⇒ Boolean
Public: tells whether the client found XSS.
-
#is_offensive? ⇒ Boolean
Public: tells whether the client found offensive words or phrases.
-
#is_spam? ⇒ Boolean
Public: tells whether the client found spam.
Constructor Details
#initialize(client) ⇒ Result
Client must have the following attributes:
#input
#output
Client must implement the following methods
#analyze(input)
#is_insecure?
#is_spammy?
#is_blacklisted?
#is_offensive?
17 18 19 20 21 |
# File 'lib/stoolie/result.rb', line 17 def initialize(client) @client = client @input = client.input @ouput = client.output end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
3 4 5 |
# File 'lib/stoolie/result.rb', line 3 def client @client end |
#input ⇒ Object
Returns the value of attribute input.
3 4 5 |
# File 'lib/stoolie/result.rb', line 3 def input @input end |
#output ⇒ Object
Returns the value of attribute output.
3 4 5 |
# File 'lib/stoolie/result.rb', line 3 def output @output end |
Instance Method Details
#is_blacklisted? ⇒ Boolean
Public: tells whether the client found blacklisted phrases
Returns a boolean
40 41 42 |
# File 'lib/stoolie/result.rb', line 40 def is_blacklisted? @client.is_blacklisted? end |
#is_insecure? ⇒ Boolean
Public: tells whether the client found XSS
Returns a boolean
26 27 28 |
# File 'lib/stoolie/result.rb', line 26 def is_insecure? @client.is_insecure? end |
#is_offensive? ⇒ Boolean
Public: tells whether the client found offensive words or phrases
Returns a boolean
47 48 49 |
# File 'lib/stoolie/result.rb', line 47 def is_offensive? @client.is_offensive? end |
#is_spam? ⇒ Boolean
Public: tells whether the client found spam
Returns a boolean
33 34 35 |
# File 'lib/stoolie/result.rb', line 33 def is_spam? @client.is_spam? end |