Class: Sorcerer::Signature
- Inherits:
-
Object
- Object
- Sorcerer::Signature
- Defined in:
- lib/sorcerer/signature.rb
Instance Attribute Summary collapse
-
#block_arg ⇒ Object
readonly
Returns the value of attribute block_arg.
-
#default_args ⇒ Object
readonly
Returns the value of attribute default_args.
-
#keyword_args ⇒ Object
readonly
Returns the value of attribute keyword_args.
-
#normal_args ⇒ Object
readonly
Returns the value of attribute normal_args.
-
#opts_arg ⇒ Object
readonly
Returns the value of attribute opts_arg.
-
#rest_arg ⇒ Object
readonly
Returns the value of attribute rest_arg.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(sexp) ⇒ Signature
constructor
A new instance of Signature.
Constructor Details
#initialize(sexp) ⇒ Signature
Returns a new instance of Signature.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/sorcerer/signature.rb', line 6 def initialize(sexp) @normal_args = sexp[1] @default_args = sexp[2] @rest_arg = sexp[3] if ruby2_style_param_list?(sexp) @keyword_args = sexp[5] @opts_arg = sexp[6] @block_arg = sexp[7] else @block_arg = sexp[5] end end |
Instance Attribute Details
#block_arg ⇒ Object (readonly)
Returns the value of attribute block_arg.
4 5 6 |
# File 'lib/sorcerer/signature.rb', line 4 def block_arg @block_arg end |
#default_args ⇒ Object (readonly)
Returns the value of attribute default_args.
4 5 6 |
# File 'lib/sorcerer/signature.rb', line 4 def default_args @default_args end |
#keyword_args ⇒ Object (readonly)
Returns the value of attribute keyword_args.
4 5 6 |
# File 'lib/sorcerer/signature.rb', line 4 def keyword_args @keyword_args end |
#normal_args ⇒ Object (readonly)
Returns the value of attribute normal_args.
4 5 6 |
# File 'lib/sorcerer/signature.rb', line 4 def normal_args @normal_args end |
#opts_arg ⇒ Object (readonly)
Returns the value of attribute opts_arg.
4 5 6 |
# File 'lib/sorcerer/signature.rb', line 4 def opts_arg @opts_arg end |
#rest_arg ⇒ Object (readonly)
Returns the value of attribute rest_arg.
4 5 6 |
# File 'lib/sorcerer/signature.rb', line 4 def rest_arg @rest_arg end |
Instance Method Details
#empty? ⇒ Boolean
19 20 21 22 23 24 25 26 |
# File 'lib/sorcerer/signature.rb', line 19 def empty? missing?(normal_args) && missing?(default_args) && missing?(rest_arg) && missing?(keyword_args) && missing?(opts_arg) && missing?(block_arg) end |