Class: Playtypus::CallContainer
- Inherits:
-
Object
- Object
- Playtypus::CallContainer
- Defined in:
- lib/playtypus/call_container.rb
Instance Attribute Summary collapse
-
#calls ⇒ Object
Returns the value of attribute calls.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(calls) ⇒ CallContainer
constructor
A new instance of CallContainer.
Constructor Details
#initialize(calls) ⇒ CallContainer
Returns a new instance of CallContainer.
17 18 19 |
# File 'lib/playtypus/call_container.rb', line 17 def initialize(calls) @calls = calls end |
Instance Attribute Details
#calls ⇒ Object
Returns the value of attribute calls.
6 7 8 |
# File 'lib/playtypus/call_container.rb', line 6 def calls @calls end |
Class Method Details
.from_log(log_content) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/playtypus/call_container.rb', line 8 def self.from_log(log_content) calls = [] json = JSON.parse(log_content.force_encoding("utf-8")) json.each do |log_entry| calls << Playtypus::Call.from_hash(log_entry) end return self.new(calls.sort_by{ |k| k.}) end |