Class: Chronicle::ETL::ChronobaseTransformer

Inherits:
Transformer
  • Object
show all
Defined in:
lib/chronicle/etl/transformers/chronobase_transformer.rb

Constant Summary collapse

PROPERTY_MAP =
{
  source: :provider,
  source_id: :provider_id,
  url: :provider_url,
  end_time: :end_at,
  start_time: :start_at,

  name: :title,
  description: :body,
  text: :body,

  recipient: :consumers,
  agent: :actor,
  object: :involved,

  # music ones
  by_artist: :creators,
  in_album: :containers
}.freeze
VERB_MAP =
{
  ListenAction: 'listened',
  CommunicateAction: 'messaged'
}.freeze
ENTITY_MAP =
{
  MusicRecording: 'song',
  MusicAlbum: 'album',
  MusicGroup: 'musicartist',
  Message: 'message',
  Person: 'person'
}.freeze

Instance Attribute Summary

Attributes inherited from Transformer

#stashed_records

Attributes included from Registry::SelfRegistering

#connector_registration

Instance Method Summary collapse

Methods inherited from Transformer

#call, #call_finish, #finish, #initialize

Methods included from Registry::SelfRegistering

#register_connector

Methods included from Configurable

included

Constructor Details

This class inherits a constructor from Chronicle::ETL::Transformer

Instance Method Details

#transform(record) ⇒ Object



44
45
46
# File 'lib/chronicle/etl/transformers/chronobase_transformer.rb', line 44

def transform(record)
  deeply_convert_record(record.data)
end