Class: Contrast::Agent::Assess::Properties
- Includes:
- Contrast::Agent::Assess::Property::Evented, Contrast::Agent::Assess::Property::Tagged, Contrast::Agent::Assess::Property::Updated, Utils::PreventSerialization
- Defined in:
- lib/contrast/agent/assess/properties.rb
Overview
Properties associated with a tracked String. If String is monkey patched this object is lazily generated on affected Strings.
This class acts as a holder for the Assess information we need in order to properly convey the events that lead up to the state of the tracked user input.
Instance Attribute Summary collapse
-
#dupped_from ⇒ Object
Returns the value of attribute dupped_from.
Attributes included from Contrast::Agent::Assess::Property::Evented
Instance Method Summary collapse
- #add_properties(hash) ⇒ Object
- #add_property(name, value) ⇒ Object
- #dup ⇒ Object
-
#properties ⇒ Object
CONTRAST-36937 Creating these on Properties is expensive.
Methods included from Contrast::Agent::Assess::Property::Updated
Methods included from Contrast::Agent::Assess::Property::Tagged
#add_tag, #any_tags_between?, #cleanup_tags, #clear_tags, #delete_tags, #delete_tags_at_ranges, #fetch_tag, #remove_tags, #set_tags, #shift_tags, #shift_tags_for_deletion, #shift_tags_for_insertion, #tag_keys, #tagged?, #tags, #tags_at, #tags_at_range, #tags_to_dtm, #tracked?
Methods included from Contrast::Agent::Assess::Property::Evented
Methods included from Utils::PreventPsychSerialization
Methods included from Utils::PreventMarshalSerialization
Instance Attribute Details
#dupped_from ⇒ Object
Returns the value of attribute dupped_from.
26 27 28 |
# File 'lib/contrast/agent/assess/properties.rb', line 26 def dupped_from @dupped_from end |
Instance Method Details
#add_properties(hash) ⇒ Object
35 36 37 38 39 |
# File 'lib/contrast/agent/assess/properties.rb', line 35 def add_properties hash return unless hash properties.merge!(hash) end |
#add_property(name, value) ⇒ Object
41 42 43 44 45 |
# File 'lib/contrast/agent/assess/properties.rb', line 41 def add_property name, value return unless name && value properties[name] = value end |
#dup ⇒ Object
47 48 49 50 51 |
# File 'lib/contrast/agent/assess/properties.rb', line 47 def dup ret = super ret.dupped_from = __id__ ret end |
#properties ⇒ Object
CONTRAST-36937 Creating these on Properties is expensive. We want to delay this for as long as possible.
31 32 33 |
# File 'lib/contrast/agent/assess/properties.rb', line 31 def properties @_properties ||= {} end |