Class: Magellan::Gcs::Proxy::MessageWrapper::ContextAccessor

Inherits:
Object
  • Object
show all
Defined in:
lib/magellan/gcs/proxy/message_wrapper.rb

Constant Summary collapse

KEYS =
[
  :workspace,
  :downloads_dir, :uploads_dir,
  :download_files,
  :local_download_files,
  :remote_download_files
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ ContextAccessor

Returns a new instance of ContextAccessor.



32
33
34
# File 'lib/magellan/gcs/proxy/message_wrapper.rb', line 32

def initialize(context)
  @context = context
end

Instance Attribute Details

#contextObject

Returns the value of attribute context.



31
32
33
# File 'lib/magellan/gcs/proxy/message_wrapper.rb', line 31

def context
  @context
end

Instance Method Details

#[](key) ⇒ Object



44
45
46
47
48
# File 'lib/magellan/gcs/proxy/message_wrapper.rb', line 44

def [](key)
  case key.to_sym
  when *KEYS then context.send(key)
  end
end

#include?(key) ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/magellan/gcs/proxy/message_wrapper.rb', line 50

def include?(key)
  KEYS.include?(key)
end