Class: Magellan::Gcs::Proxy::MessageWrapper::ContextAccessor
- Inherits:
-
Object
- Object
- Magellan::Gcs::Proxy::MessageWrapper::ContextAccessor
- 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
-
#context ⇒ Object
Returns the value of attribute context.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #include?(key) ⇒ Boolean
-
#initialize(context) ⇒ ContextAccessor
constructor
A new instance of ContextAccessor.
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
#context ⇒ Object
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
50 51 52 |
# File 'lib/magellan/gcs/proxy/message_wrapper.rb', line 50 def include?(key) KEYS.include?(key) end |