Class: JumpBack::OptionsParser
- Inherits:
-
Object
- Object
- JumpBack::OptionsParser
- Defined in:
- lib/jump_back/options_parser.rb
Instance Attribute Summary collapse
-
#jump_back_options ⇒ Object
readonly
Returns the value of attribute jump_back_options.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#redirect_options ⇒ Object
readonly
Returns the value of attribute redirect_options.
Instance Method Summary collapse
-
#initialize(options) ⇒ OptionsParser
constructor
A new instance of OptionsParser.
- #parse(options) ⇒ Object
Constructor Details
#initialize(options) ⇒ OptionsParser
Returns a new instance of OptionsParser.
7 8 9 10 11 |
# File 'lib/jump_back/options_parser.rb', line 7 def initialize() @path = parse()[:path] @redirect_options = parse()[:redirect_options] @jump_back_options = parse()[:jump_back_options] end |
Instance Attribute Details
#jump_back_options ⇒ Object (readonly)
Returns the value of attribute jump_back_options.
5 6 7 |
# File 'lib/jump_back/options_parser.rb', line 5 def @jump_back_options end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/jump_back/options_parser.rb', line 5 def path @path end |
#redirect_options ⇒ Object (readonly)
Returns the value of attribute redirect_options.
5 6 7 |
# File 'lib/jump_back/options_parser.rb', line 5 def @redirect_options end |
Instance Method Details
#parse(options) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/jump_back/options_parser.rb', line 13 def parse() return @options if @options if [:path].is_a? Hash [:options] = [:path] [:path] = [:default] end [:jump_back_options] = { offsite: [:options].delete(:offsite) } [:redirect_options] = .delete(:options) @options = end |