Class: Readme::Har::Collection
- Inherits:
-
Object
- Object
- Readme::Har::Collection
- Defined in:
- lib/readme/har/collection.rb
Instance Method Summary collapse
-
#initialize(filter, hash) ⇒ Collection
constructor
A new instance of Collection.
- #to_a ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(filter, hash) ⇒ Collection
Returns a new instance of Collection.
6 7 8 9 |
# File 'lib/readme/har/collection.rb', line 6 def initialize(filter, hash) @filter = filter @hash = hash end |
Instance Method Details
#to_a ⇒ Object
15 16 17 |
# File 'lib/readme/har/collection.rb', line 15 def to_a filtered_hash.map { |name, value| { name: name, value: value.is_a?(Hash) ? value.to_json : value } } end |
#to_h ⇒ Object
11 12 13 |
# File 'lib/readme/har/collection.rb', line 11 def to_h filtered_hash end |