Class: EventMeter::ReportDefinition::Interval
- Inherits:
-
Struct
- Object
- Struct
- EventMeter::ReportDefinition::Interval
- Defined in:
- lib/event_meter/report_definition.rb
Instance Attribute Summary collapse
-
#group_by ⇒ Object
Returns the value of attribute group_by.
-
#param ⇒ Object
Returns the value of attribute param.
Instance Method Summary collapse
- #group_index ⇒ Object
-
#initialize(param:, group_by: []) ⇒ Interval
constructor
A new instance of Interval.
- #to_h ⇒ Object
Constructor Details
#initialize(param:, group_by: []) ⇒ Interval
Returns a new instance of Interval.
23 24 25 26 27 28 |
# File 'lib/event_meter/report_definition.rb', line 23 def initialize(param:, group_by: []) super( param: ReportDefinition.normalize_param(param), group_by: ReportDefinition.normalize_params(group_by) ) end |
Instance Attribute Details
#group_by ⇒ Object
Returns the value of attribute group_by
22 23 24 |
# File 'lib/event_meter/report_definition.rb', line 22 def group_by @group_by end |
#param ⇒ Object
Returns the value of attribute param
22 23 24 |
# File 'lib/event_meter/report_definition.rb', line 22 def param @param end |
Instance Method Details
#group_index ⇒ Object
30 31 32 |
# File 'lib/event_meter/report_definition.rb', line 30 def group_index Index.new(params: group_by) end |
#to_h ⇒ Object
34 35 36 37 38 39 |
# File 'lib/event_meter/report_definition.rb', line 34 def to_h { "param" => param.to_s, "group_by" => group_by.map(&:to_s) } end |