Class: HAR::PageTimings
- Inherits:
-
SchemaType
- Object
- SchemaType
- HAR::PageTimings
- Defined in:
- lib/har/page_timings.rb
Instance Method Summary collapse
- #custom ⇒ Object
-
#initialize(input) ⇒ PageTimings
constructor
A new instance of PageTimings.
Methods included from Serializable
#==, #as_json, #inspect, #to_json
Constructor Details
#initialize(input) ⇒ PageTimings
Returns a new instance of PageTimings.
3 4 5 6 |
# File 'lib/har/page_timings.rb', line 3 def initialize(input) super(input) @input = input end |
Instance Method Details
#custom ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/har/page_timings.rb', line 8 def custom @custom ||= begin # TODO: move to `transform_keys` once ruby 2.0.0 support is dropped custom_timings = Hash[@input.select { |key| key.start_with?('_') } .map { |key, val| [key[1..-1], val] }] OpenStruct.new(custom_timings) end end |