Class: MethodArgs::ArgList
- Inherits:
-
Array
- Object
- Array
- MethodArgs::ArgList
- Defined in:
- lib/method_args.rb
Defined Under Namespace
Classes: Arg
Instance Attribute Summary collapse
-
#cls ⇒ Object
readonly
Returns the value of attribute cls.
-
#owning_method ⇒ Object
Returns the value of attribute owning_method.
Instance Method Summary collapse
- #clone ⇒ Object
-
#initialize(cls) ⇒ ArgList
constructor
A new instance of ArgList.
- #names ⇒ Object
- #required_size ⇒ Object (also: #required_count)
- #types ⇒ Object
Constructor Details
#initialize(cls) ⇒ ArgList
Returns a new instance of ArgList.
54 55 56 |
# File 'lib/method_args.rb', line 54 def initialize(cls) @cls = cls end |
Instance Attribute Details
#cls ⇒ Object (readonly)
Returns the value of attribute cls.
52 53 54 |
# File 'lib/method_args.rb', line 52 def cls @cls end |
#owning_method ⇒ Object
Returns the value of attribute owning_method.
51 52 53 |
# File 'lib/method_args.rb', line 51 def owning_method @owning_method end |
Instance Method Details
#clone ⇒ Object
58 59 60 61 62 |
# File 'lib/method_args.rb', line 58 def clone o = super o.each {|arg| arg.arg_list = o} o end |
#names ⇒ Object
69 70 71 |
# File 'lib/method_args.rb', line 69 def names map(&:name) end |
#required_size ⇒ Object Also known as: required_count
64 65 66 |
# File 'lib/method_args.rb', line 64 def required_size inject(0) {|count, arg| count += arg.required? ? 1 : 0} end |
#types ⇒ Object
73 74 75 |
# File 'lib/method_args.rb', line 73 def types map(&:type) end |