Class: Readme::Har::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/readme/har/collection.rb

Instance Method Summary collapse

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_aObject



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_hObject



11
12
13
# File 'lib/readme/har/collection.rb', line 11

def to_h
  filtered_hash
end