Class: Adhoq::Report
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Adhoq::Report
- Defined in:
- app/models/adhoq/report.rb
Instance Method Summary collapse
- #available? ⇒ Boolean
- #data(storage = Adhoq.current_storage) ⇒ Object
- #data_url(storage = Adhoq.current_storage) ⇒ Object
- #generate!(storage = Adhoq.current_storage) ⇒ Object
- #mime_type ⇒ Object
- #on_the_fly? ⇒ Boolean
Instance Method Details
#available? ⇒ Boolean
19 20 21 |
# File 'app/models/adhoq/report.rb', line 19 def available? identifier.present? && (storage == Adhoq.current_storage.identifier) end |
#data(storage = Adhoq.current_storage) ⇒ Object
23 24 25 |
# File 'app/models/adhoq/report.rb', line 23 def data(storage = Adhoq.current_storage) storage.get(identifier) end |
#data_url(storage = Adhoq.current_storage) ⇒ Object
27 28 29 |
# File 'app/models/adhoq/report.rb', line 27 def data_url(storage = Adhoq.current_storage) storage.get_url(self) end |
#generate!(storage = Adhoq.current_storage) ⇒ Object
7 8 9 10 11 12 13 |
# File 'app/models/adhoq/report.rb', line 7 def generate!(storage = Adhoq.current_storage) self.identifier = generate_and_persist_report!(storage) self.generated_at = Time.now self.storage = storage.identifier save! end |