Class: InformantRails::Request
- Inherits:
-
Object
- Object
- InformantRails::Request
- Defined in:
- lib/informant-rails/request.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#request_url ⇒ Object
Returns the value of attribute request_url.
Instance Method Summary collapse
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
3 4 5 |
# File 'lib/informant-rails/request.rb', line 3 def action @action end |
#filename ⇒ Object
Returns the value of attribute filename.
3 4 5 |
# File 'lib/informant-rails/request.rb', line 3 def filename @filename end |
#request_url ⇒ Object
Returns the value of attribute request_url.
3 4 5 |
# File 'lib/informant-rails/request.rb', line 3 def request_url @request_url end |
Instance Method Details
#as_json(*args) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/informant-rails/request.rb', line 15 def as_json(*args) { models: models.map(&:as_json), request_url: request_url, filename: filename, action: action, client: InformantRails::Config.client_identifier } end |
#models ⇒ Object
11 12 13 |
# File 'lib/informant-rails/request.rb', line 11 def models @models ||= [] end |
#process_model(model) ⇒ Object
5 6 7 8 9 |
# File 'lib/informant-rails/request.rb', line 5 def process_model(model) if model && untracked?(model) models << InformantRails::Model.new(model) end end |