Class: StreamRails::ActivityResult
- Inherits:
-
Hash
- Object
- Hash
- StreamRails::ActivityResult
- Defined in:
- lib/stream_rails/enrich.rb
Instance Attribute Summary collapse
-
#enriched ⇒ Object
Returns the value of attribute enriched.
-
#failed_to_enrich ⇒ Object
readonly
Returns the value of attribute failed_to_enrich.
Instance Method Summary collapse
- #enriched? ⇒ Boolean
- #from_activity(h) ⇒ Object
-
#initialize ⇒ ActivityResult
constructor
A new instance of ActivityResult.
- #not_enriched_fields ⇒ Object
- #track_not_enriched_field(field, value = nil) ⇒ Object
Constructor Details
#initialize ⇒ ActivityResult
Returns a new instance of ActivityResult.
9 10 11 12 |
# File 'lib/stream_rails/enrich.rb', line 9 def initialize @failed_to_enrich = Hash.new super end |
Instance Attribute Details
#enriched ⇒ Object
Returns the value of attribute enriched.
6 7 8 |
# File 'lib/stream_rails/enrich.rb', line 6 def enriched @enriched end |
#failed_to_enrich ⇒ Object (readonly)
Returns the value of attribute failed_to_enrich.
7 8 9 |
# File 'lib/stream_rails/enrich.rb', line 7 def failed_to_enrich @failed_to_enrich end |
Instance Method Details
#enriched? ⇒ Boolean
18 19 20 |
# File 'lib/stream_rails/enrich.rb', line 18 def enriched? @failed_to_enrich.keys.length == 0 end |
#from_activity(h) ⇒ Object
14 15 16 |
# File 'lib/stream_rails/enrich.rb', line 14 def from_activity(h) self.merge(h) end |
#not_enriched_fields ⇒ Object
22 23 24 |
# File 'lib/stream_rails/enrich.rb', line 22 def not_enriched_fields @failed_to_enrich.keys end |
#track_not_enriched_field(field, value = nil) ⇒ Object
26 27 28 |
# File 'lib/stream_rails/enrich.rb', line 26 def track_not_enriched_field(field, value = nil) @failed_to_enrich[field] = value end |