Class: Wpxf::Cli::Context
- Inherits:
-
Object
- Object
- Wpxf::Cli::Context
- Defined in:
- lib/wpxf/cli/context.rb
Overview
A context which modules will be used in.
Instance Attribute Summary collapse
-
#module ⇒ Object
readonly
Returns the value of attribute module.
-
#module_path ⇒ Object
readonly
Returns the value of attribute module_path.
Instance Method Summary collapse
Instance Attribute Details
#module ⇒ Object (readonly)
Returns the value of attribute module.
32 33 34 |
# File 'lib/wpxf/cli/context.rb', line 32 def module @module end |
#module_path ⇒ Object (readonly)
Returns the value of attribute module_path.
31 32 33 |
# File 'lib/wpxf/cli/context.rb', line 31 def module_path @module_path end |
Instance Method Details
#load_module(path) ⇒ Object
14 15 16 17 18 |
# File 'lib/wpxf/cli/context.rb', line 14 def load_module(path) @module = Wpxf.load_module(path) @module_path = path @module end |
#load_payload(name) ⇒ Object
25 26 27 28 29 |
# File 'lib/wpxf/cli/context.rb', line 25 def load_payload(name) self.module.payload = Wpxf::Payloads.load_payload(name) self.module.payload.check(self.module) self.module.payload end |
#reload ⇒ Object
20 21 22 23 |
# File 'lib/wpxf/cli/context.rb', line 20 def reload load("wpxf/modules/#{@module_path}.rb") load_module(@module_path) end |
#verbose? ⇒ Boolean
9 10 11 12 |
# File 'lib/wpxf/cli/context.rb', line 9 def verbose? return false if self.module.nil? self.module.normalized_option_value('verbose') end |