Class: Algolia::NormalizeId
- Inherits:
-
ApplicationService
- Object
- ApplicationService
- Algolia::NormalizeId
- Defined in:
- lib/storage/algolia/normalize_id.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ NormalizeId
constructor
A new instance of NormalizeId.
- #process ⇒ Object
Methods inherited from ApplicationService
Constructor Details
#initialize(data) ⇒ NormalizeId
Returns a new instance of NormalizeId.
9 10 11 |
# File 'lib/storage/algolia/normalize_id.rb', line 9 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/storage/algolia/normalize_id.rb', line 7 def data @data end |
Instance Method Details
#process ⇒ Object
13 14 15 16 17 |
# File 'lib/storage/algolia/normalize_id.rb', line 13 def process data.kind_of?(Array) ? data.map { |node| objectid_to_id(node) }.to_hashugar : objectid_to_id(data) end |