Class: HecksPackager::Args
- Inherits:
-
Object
- Object
- HecksPackager::Args
- Defined in:
- lib/packager/args.rb
Overview
represents the args passed in
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
- #data ⇒ Object
- #domain_module ⇒ Object
-
#initialize(command_args) ⇒ Args
constructor
A new instance of Args.
Constructor Details
#initialize(command_args) ⇒ Args
Returns a new instance of Args.
6 7 8 9 10 |
# File 'lib/packager/args.rb', line 6 def initialize(command_args) @domain_module = command_args[0] @method = command_args[1] @data = command_args[2] end |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
4 5 6 |
# File 'lib/packager/args.rb', line 4 def method @method end |
Instance Method Details
#data ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/packager/args.rb', line 16 def data json = JSON.parse(@data, symbolize_names: true) if(@method == 'delete') return json[:id] else json end end |
#domain_module ⇒ Object
12 13 14 |
# File 'lib/packager/args.rb', line 12 def domain_module @domain_module.to_sym end |