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

Parameters:

  • opts (Hash)

    options



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

def initialize(opts)
  @opts = opts
end

Instance Attribute Details

#optsHash (readonly)

Returns context_metadata options.

Returns:

  • (Hash)

    context_metadata options



77
78
79
# File 'lib/serega/plugins/context_metadata/context_metadata.rb', line 77

def opts
  @opts
end

Instance Method Details

#keyObject

Key that should be used to define metadata



90
91
92
# File 'lib/serega/plugins/context_metadata/context_metadata.rb', line 90

def key
  opts.fetch(:key)
end

#key=(new_key) ⇒ Symbol

Sets key that should be used to define metadata

Parameters:

  • new_key (Symbol)

    New key

Returns:

  • (Symbol)

    New key



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

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