Class: Delfos::MethodLogging::MethodParameters
- Inherits:
-
Object
- Object
- Delfos::MethodLogging::MethodParameters
- Defined in:
- lib/delfos/method_logging/method_parameters.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
- #args ⇒ Object
- #argument_classes ⇒ Object
- #as_json(*params) ⇒ Object
-
#initialize(args = [], keyword_args = nil, block = nil) ⇒ MethodParameters
constructor
A new instance of MethodParameters.
- #keyword_args ⇒ Object
Constructor Details
#initialize(args = [], keyword_args = nil, block = nil) ⇒ MethodParameters
Returns a new instance of MethodParameters.
9 10 11 12 13 |
# File 'lib/delfos/method_logging/method_parameters.rb', line 9 def initialize(args=[], keyword_args=nil, block=nil) @raw_args = args @raw_keyword_args = keyword_args @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
7 8 9 |
# File 'lib/delfos/method_logging/method_parameters.rb', line 7 def block @block end |
Instance Method Details
#args ⇒ Object
15 16 17 |
# File 'lib/delfos/method_logging/method_parameters.rb', line 15 def args @args ||= calculate_args(@raw_args) end |
#argument_classes ⇒ Object
19 20 21 |
# File 'lib/delfos/method_logging/method_parameters.rb', line 19 def argument_classes (args + keyword_args).uniq end |
#as_json(*params) ⇒ Object
27 28 29 |
# File 'lib/delfos/method_logging/method_parameters.rb', line 27 def as_json(*params) {arguments: args, keyword_arguments: keyword_args} end |
#keyword_args ⇒ Object
23 24 25 |
# File 'lib/delfos/method_logging/method_parameters.rb', line 23 def keyword_args @keyword_args ||= calculate_args(@raw_keyword_args.values) end |