Class: StreamRails::ActivityResult

Inherits:
Hash
  • Object
show all
Defined in:
lib/stream_rails/enrich.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeActivityResult

Returns a new instance of ActivityResult.



8
9
10
11
# File 'lib/stream_rails/enrich.rb', line 8

def initialize
  @failed_to_enrich = {}
  super
end

Instance Attribute Details

#enrichedObject

Returns the value of attribute enriched.



5
6
7
# File 'lib/stream_rails/enrich.rb', line 5

def enriched
  @enriched
end

#failed_to_enrichObject (readonly)

Returns the value of attribute failed_to_enrich.



6
7
8
# File 'lib/stream_rails/enrich.rb', line 6

def failed_to_enrich
  @failed_to_enrich
end

Instance Method Details

#enriched?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/stream_rails/enrich.rb', line 17

def enriched?
  @failed_to_enrich.keys.length.zero?
end

#from_activity(from) ⇒ Object



13
14
15
# File 'lib/stream_rails/enrich.rb', line 13

def from_activity(from)
  merge(from)
end

#not_enriched_fieldsObject



21
22
23
# File 'lib/stream_rails/enrich.rb', line 21

def not_enriched_fields
  @failed_to_enrich.keys
end

#track_not_enriched_field(field, value = nil) ⇒ Object



25
26
27
# File 'lib/stream_rails/enrich.rb', line 25

def track_not_enriched_field(field, value = nil)
  @failed_to_enrich[field] = value
end