Class: Serega::SeregaPlugins::ContextMetadata::ContextMetadataConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/serega/plugins/context_metadata/context_metadata.rb

Overview

Config for ‘context_metadata` plugin

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Serega::SeregaPlugins::ContextMetadata::ContextMetadataConfig

Initializes context_metadata config object



94
95
96
# File 'lib/serega/plugins/context_metadata/context_metadata.rb', line 94

def initialize(opts)
  @opts = opts
end

Instance Attribute Details

#optsHash (readonly)



86
87
88
# File 'lib/serega/plugins/context_metadata/context_metadata.rb', line 86

def opts
  @opts
end

Instance Method Details

#keyObject

Key that should be used to define metadata



99
100
101
# File 'lib/serega/plugins/context_metadata/context_metadata.rb', line 99

def key
  opts.fetch(:key)
end

#key=(new_key) ⇒ Symbol

Sets key that should be used to define metadata



108
109
110
# File 'lib/serega/plugins/context_metadata/context_metadata.rb', line 108

def key=(new_key)
  opts[:key] = new_key
end