Class: Prevoty::Intelligence
- Inherits:
-
Object
- Object
- Prevoty::Intelligence
- Defined in:
- lib/prevoty/responses/query_analysis.rb
Instance Attribute Summary collapse
-
#column_reads ⇒ Object
readonly
Returns the value of attribute column_reads.
-
#column_updates ⇒ Object
readonly
Returns the value of attribute column_updates.
-
#comparison_types ⇒ Object
readonly
Returns the value of attribute comparison_types.
-
#function_calls ⇒ Object
readonly
Returns the value of attribute function_calls.
-
#has_admin ⇒ Object
readonly
Returns the value of attribute has_admin.
-
#has_comment ⇒ Object
readonly
Returns the value of attribute has_comment.
-
#hashed_statement ⇒ Object
readonly
Returns the value of attribute hashed_statement.
-
#joins ⇒ Object
readonly
Returns the value of attribute joins.
-
#row_creates ⇒ Object
readonly
Returns the value of attribute row_creates.
-
#row_deletes ⇒ Object
readonly
Returns the value of attribute row_deletes.
-
#sanitized_statement ⇒ Object
readonly
Returns the value of attribute sanitized_statement.
-
#statement_type ⇒ Object
readonly
Returns the value of attribute statement_type.
-
#subqueries ⇒ Object
readonly
Returns the value of attribute subqueries.
-
#unions ⇒ Object
readonly
Returns the value of attribute unions.
Instance Method Summary collapse
-
#initialize(data) ⇒ Intelligence
constructor
A new instance of Intelligence.
- #to_json(options) ⇒ Object
Constructor Details
#initialize(data) ⇒ Intelligence
Returns a new instance of Intelligence.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/prevoty/responses/query_analysis.rb', line 68 def initialize(data) @statement_type = data["statement_type"] @sanitized_statement = data["sanitized_statement"] @hashed_statement = data["hashed_statement"] @has_comment = data["has_comment"] @comparison_types = ComparisonTypes.new(data["comparison_types"]) @row_creates = data["row_creates"].map {|el| Table.new(el)} @column_reads = data["column_reads"].map {|el| Column.new(el)} @column_updates = data["column_updates"].map {|el| Column.new(el)} @row_deletes = data["row_deletes"].map {|el| Table.new(el)} @has_admin = data["has_admin"] @function_calls = data["function_calls"].map {|el| FunctionCall.new(el)} @joins = data["joins"].map {|el| Table.new(el)} @unions = data["unions"].map {|el| Table.new(el)} @subqueries = data["subqueries"].map {|el| Table.new(el)} end |
Instance Attribute Details
#column_reads ⇒ Object (readonly)
Returns the value of attribute column_reads.
63 64 65 |
# File 'lib/prevoty/responses/query_analysis.rb', line 63 def column_reads @column_reads end |
#column_updates ⇒ Object (readonly)
Returns the value of attribute column_updates.
63 64 65 |
# File 'lib/prevoty/responses/query_analysis.rb', line 63 def column_updates @column_updates end |
#comparison_types ⇒ Object (readonly)
Returns the value of attribute comparison_types.
63 64 65 |
# File 'lib/prevoty/responses/query_analysis.rb', line 63 def comparison_types @comparison_types end |
#function_calls ⇒ Object (readonly)
Returns the value of attribute function_calls.
63 64 65 |
# File 'lib/prevoty/responses/query_analysis.rb', line 63 def function_calls @function_calls end |
#has_admin ⇒ Object (readonly)
Returns the value of attribute has_admin.
63 64 65 |
# File 'lib/prevoty/responses/query_analysis.rb', line 63 def has_admin @has_admin end |
#has_comment ⇒ Object (readonly)
Returns the value of attribute has_comment.
63 64 65 |
# File 'lib/prevoty/responses/query_analysis.rb', line 63 def has_comment @has_comment end |
#hashed_statement ⇒ Object (readonly)
Returns the value of attribute hashed_statement.
63 64 65 |
# File 'lib/prevoty/responses/query_analysis.rb', line 63 def hashed_statement @hashed_statement end |
#joins ⇒ Object (readonly)
Returns the value of attribute joins.
63 64 65 |
# File 'lib/prevoty/responses/query_analysis.rb', line 63 def joins @joins end |
#row_creates ⇒ Object (readonly)
Returns the value of attribute row_creates.
63 64 65 |
# File 'lib/prevoty/responses/query_analysis.rb', line 63 def row_creates @row_creates end |
#row_deletes ⇒ Object (readonly)
Returns the value of attribute row_deletes.
63 64 65 |
# File 'lib/prevoty/responses/query_analysis.rb', line 63 def row_deletes @row_deletes end |
#sanitized_statement ⇒ Object (readonly)
Returns the value of attribute sanitized_statement.
63 64 65 |
# File 'lib/prevoty/responses/query_analysis.rb', line 63 def sanitized_statement @sanitized_statement end |
#statement_type ⇒ Object (readonly)
Returns the value of attribute statement_type.
63 64 65 |
# File 'lib/prevoty/responses/query_analysis.rb', line 63 def statement_type @statement_type end |
#subqueries ⇒ Object (readonly)
Returns the value of attribute subqueries.
63 64 65 |
# File 'lib/prevoty/responses/query_analysis.rb', line 63 def subqueries @subqueries end |
#unions ⇒ Object (readonly)
Returns the value of attribute unions.
63 64 65 |
# File 'lib/prevoty/responses/query_analysis.rb', line 63 def unions @unions end |
Instance Method Details
#to_json(options) ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/prevoty/responses/query_analysis.rb', line 85 def to_json() return { statement_type: @statement_type, sanitized_statement: @sanitized_statement, hashed_statement: @hashed_statement, has_comment: @has_comment, comparison_types: @comparison_types, row_creates: @row_creates, column_reads: @column_reads, column_upates: @column_updates, row_deletes: @row_deletes, has_admin: @has_admin, function_calls: @function_calls, joins: @joins, unions: @unions, subqueries: @subqueries }.to_json end |