Class: Prevoty::Violations
- Inherits:
-
Object
- Object
- Prevoty::Violations
- Defined in:
- lib/prevoty/responses/query_analysis.rb
Instance Attribute Summary collapse
-
#admin_violation ⇒ Object
readonly
Returns the value of attribute admin_violation.
-
#column_read_violations ⇒ Object
readonly
Returns the value of attribute column_read_violations.
-
#column_update_violations ⇒ Object
readonly
Returns the value of attribute column_update_violations.
-
#function_violations ⇒ Object
readonly
Returns the value of attribute function_violations.
-
#join_violations ⇒ Object
readonly
Returns the value of attribute join_violations.
-
#row_create_violations ⇒ Object
readonly
Returns the value of attribute row_create_violations.
-
#row_delete_violation ⇒ Object
readonly
Returns the value of attribute row_delete_violation.
-
#subquery_violations ⇒ Object
readonly
Returns the value of attribute subquery_violations.
-
#union_violations ⇒ Object
readonly
Returns the value of attribute union_violations.
Instance Method Summary collapse
-
#initialize(data) ⇒ Violations
constructor
A new instance of Violations.
- #to_json(options) ⇒ Object
Constructor Details
#initialize(data) ⇒ Violations
Returns a new instance of Violations.
168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/prevoty/responses/query_analysis.rb', line 168 def initialize(data) @row_create_violations = data["row_create_violations"].map {|el| Table.new(el)} @column_read_violations = data["column_read_violations"].map {|el| Column.new(el)} @column_update_violations = data["column_update_violations"].map {|el| Column.new(el)} @row_delete_violations = data["row_delete_violations"].map {|el| Table.new(el)} @admin_violation = data["admin_violation"] @union_violations = data["union_violations"].map {|el| Table.new(el)} @join_violations = data["join_violations"].map {|el| Table.new(el)} @subquery_violations = data["subquery_violations"].map {|el| Table.new(el)} @function_violations = data["function_violations"].map {|el| FunctionCall.new(el)} end |
Instance Attribute Details
#admin_violation ⇒ Object (readonly)
Returns the value of attribute admin_violation.
164 165 166 |
# File 'lib/prevoty/responses/query_analysis.rb', line 164 def admin_violation @admin_violation end |
#column_read_violations ⇒ Object (readonly)
Returns the value of attribute column_read_violations.
164 165 166 |
# File 'lib/prevoty/responses/query_analysis.rb', line 164 def column_read_violations @column_read_violations end |
#column_update_violations ⇒ Object (readonly)
Returns the value of attribute column_update_violations.
164 165 166 |
# File 'lib/prevoty/responses/query_analysis.rb', line 164 def column_update_violations @column_update_violations end |
#function_violations ⇒ Object (readonly)
Returns the value of attribute function_violations.
164 165 166 |
# File 'lib/prevoty/responses/query_analysis.rb', line 164 def function_violations @function_violations end |
#join_violations ⇒ Object (readonly)
Returns the value of attribute join_violations.
164 165 166 |
# File 'lib/prevoty/responses/query_analysis.rb', line 164 def join_violations @join_violations end |
#row_create_violations ⇒ Object (readonly)
Returns the value of attribute row_create_violations.
164 165 166 |
# File 'lib/prevoty/responses/query_analysis.rb', line 164 def row_create_violations @row_create_violations end |
#row_delete_violation ⇒ Object (readonly)
Returns the value of attribute row_delete_violation.
164 165 166 |
# File 'lib/prevoty/responses/query_analysis.rb', line 164 def row_delete_violation @row_delete_violation end |
#subquery_violations ⇒ Object (readonly)
Returns the value of attribute subquery_violations.
164 165 166 |
# File 'lib/prevoty/responses/query_analysis.rb', line 164 def subquery_violations @subquery_violations end |
#union_violations ⇒ Object (readonly)
Returns the value of attribute union_violations.
164 165 166 |
# File 'lib/prevoty/responses/query_analysis.rb', line 164 def union_violations @union_violations end |
Instance Method Details
#to_json(options) ⇒ Object
180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/prevoty/responses/query_analysis.rb', line 180 def to_json() return { row_create_violations: @row_create_violations, column_read_violations: @column_read_violations, column_update_violations: @column_update_violations, row_delete_violations: @row_delete_violations, admin_violation: @admin_violation, union_violation: @union_violation, join_violations: @join_violations, subquery_violations: @subquery_violations, function_violations: @function_violations }.to_json end |