Class: ActionCost::RecordCacheParser
- Inherits:
-
Object
- Object
- ActionCost::RecordCacheParser
- Defined in:
- lib/action_cost/record_cache_parser.rb
Constant Summary collapse
- VALID_OPERATIONS =
%w{ select insert update delete }
Instance Attribute Summary collapse
-
#invalid ⇒ Object
readonly
Returns the value of attribute invalid.
-
#join_tables ⇒ Object
readonly
Returns the value of attribute join_tables.
-
#operation ⇒ Object
readonly
Returns the value of attribute operation.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
-
#initialize(table_name) ⇒ RecordCacheParser
constructor
A new instance of RecordCacheParser.
- #log ⇒ Object
- #parse ⇒ Object
Constructor Details
#initialize(table_name) ⇒ RecordCacheParser
Returns a new instance of RecordCacheParser.
7 8 9 10 11 12 |
# File 'lib/action_cost/record_cache_parser.rb', line 7 def initialize(table_name) @invalid = false @table_name = table_name @join_tables = [] @operation = 'select' end |
Instance Attribute Details
#invalid ⇒ Object (readonly)
Returns the value of attribute invalid.
3 4 5 |
# File 'lib/action_cost/record_cache_parser.rb', line 3 def invalid @invalid end |
#join_tables ⇒ Object (readonly)
Returns the value of attribute join_tables.
3 4 5 |
# File 'lib/action_cost/record_cache_parser.rb', line 3 def join_tables @join_tables end |
#operation ⇒ Object (readonly)
Returns the value of attribute operation.
3 4 5 |
# File 'lib/action_cost/record_cache_parser.rb', line 3 def operation @operation end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
3 4 5 |
# File 'lib/action_cost/record_cache_parser.rb', line 3 def table_name @table_name end |
Instance Method Details
#log ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/action_cost/record_cache_parser.rb', line 18 def log if @invalid Rails.logger.debug "action_cost: record cache non parsable query" else Rails.logger.debug "action_cost: record_cache operation=#{@operation} table_name=#{@table_name} " + "join_tables=#{@join_tables.inspect}" end end |
#parse ⇒ Object
14 15 16 |
# File 'lib/action_cost/record_cache_parser.rb', line 14 def parse return true end |