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.



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

def initialize
  @failed_to_enrich = Hash.new
  super
end

Instance Attribute Details

#enrichedObject

Returns the value of attribute enriched.



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

def enriched
  @enriched
end

#failed_to_enrichObject (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

Returns:

  • (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_fieldsObject



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