Class: Clickwrap::RetentionClass::Rule
- Inherits:
-
Data
- Object
- Data
- Clickwrap::RetentionClass::Rule
- Defined in:
- lib/clickwrap/retention_class.rb
Overview
A rule is either a duration from the event's server-recorded time, or the name of a host-registered calculation that may depend on domain state and may not be resolvable yet.
Instance Attribute Summary collapse
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#host_event_name ⇒ Object
readonly
Returns the value of attribute host_event_name.
-
#part ⇒ Object
readonly
Returns the value of attribute part.
Instance Method Summary collapse
- #duration? ⇒ Boolean
- #host_event? ⇒ Boolean
-
#initialize(part:, duration: nil, host_event_name: nil) ⇒ Rule
constructor
A new instance of Rule.
- #to_snapshot ⇒ Object
Constructor Details
#initialize(part:, duration: nil, host_event_name: nil) ⇒ Rule
Returns a new instance of Rule.
28 29 30 |
# File 'lib/clickwrap/retention_class.rb', line 28 def initialize(part:, duration: nil, host_event_name: nil) super end |
Instance Attribute Details
#duration ⇒ Object (readonly)
Returns the value of attribute duration
27 28 29 |
# File 'lib/clickwrap/retention_class.rb', line 27 def duration @duration end |
#host_event_name ⇒ Object (readonly)
Returns the value of attribute host_event_name
27 28 29 |
# File 'lib/clickwrap/retention_class.rb', line 27 def host_event_name @host_event_name end |
#part ⇒ Object (readonly)
Returns the value of attribute part
27 28 29 |
# File 'lib/clickwrap/retention_class.rb', line 27 def part @part end |
Instance Method Details
#duration? ⇒ Boolean
32 |
# File 'lib/clickwrap/retention_class.rb', line 32 def duration? = !duration.nil? |
#host_event? ⇒ Boolean
33 |
# File 'lib/clickwrap/retention_class.rb', line 33 def host_event? = !host_event_name.nil? |
#to_snapshot ⇒ Object
35 36 37 |
# File 'lib/clickwrap/retention_class.rb', line 35 def to_snapshot { "duration_seconds" => duration&.to_i, "host_event" => host_event_name&.to_s }.compact end |