Class: PulseAnalysis::Report
- Inherits:
-
Object
- Object
- PulseAnalysis::Report
- Defined in:
- lib/pulse-analysis/report.rb
Instance Attribute Summary collapse
-
#analysis ⇒ Object
readonly
Returns the value of attribute analysis.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Instance Method Summary collapse
-
#initialize(analysis) ⇒ Report
constructor
A new instance of Report.
-
#inspect ⇒ String
Override Object#inspect to not include the large audio data.
-
#to_h ⇒ Hash
Convert the report to a hash.
Constructor Details
#initialize(analysis) ⇒ Report
Returns a new instance of Report.
8 9 10 11 |
# File 'lib/pulse-analysis/report.rb', line 8 def initialize(analysis) @analysis = analysis populate_items end |
Instance Attribute Details
#analysis ⇒ Object (readonly)
Returns the value of attribute analysis.
5 6 7 |
# File 'lib/pulse-analysis/report.rb', line 5 def analysis @analysis end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
5 6 7 |
# File 'lib/pulse-analysis/report.rb', line 5 def items @items end |
Instance Method Details
#inspect ⇒ String
Override Object#inspect to not include the large audio data
26 27 28 |
# File 'lib/pulse-analysis/report.rb', line 26 def inspect to_h.inspect end |
#to_h ⇒ Hash
Convert the report to a hash
15 16 17 18 19 20 21 22 |
# File 'lib/pulse-analysis/report.rb', line 15 def to_h { file: { path: @analysis.sound.audio_file.path.to_s }, analysis: @items } end |