Class: Gelauto::ArgList
- Inherits:
-
Object
- Object
- Gelauto::ArgList
- Includes:
- Enumerable
- Defined in:
- lib/gelauto/arg_list.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
Instance Method Summary collapse
- #<<(arg) ⇒ Object
- #[](idx) ⇒ Object
- #each(&block) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(args = []) ⇒ ArgList
constructor
A new instance of ArgList.
- #to_sig ⇒ Object
Constructor Details
#initialize(args = []) ⇒ ArgList
Returns a new instance of ArgList.
7 8 9 |
# File 'lib/gelauto/arg_list.rb', line 7 def initialize(args = []) @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
5 6 7 |
# File 'lib/gelauto/arg_list.rb', line 5 def args @args end |
Instance Method Details
#<<(arg) ⇒ Object
11 12 13 |
# File 'lib/gelauto/arg_list.rb', line 11 def <<(arg) args << arg end |
#[](idx) ⇒ Object
15 16 17 |
# File 'lib/gelauto/arg_list.rb', line 15 def [](idx) args[idx] end |
#each(&block) ⇒ Object
23 24 25 |
# File 'lib/gelauto/arg_list.rb', line 23 def each(&block) args.each(&block) end |
#empty? ⇒ Boolean
19 20 21 |
# File 'lib/gelauto/arg_list.rb', line 19 def empty? args.empty? end |
#to_sig ⇒ Object
27 28 29 30 |
# File 'lib/gelauto/arg_list.rb', line 27 def to_sig return '' if args.empty? args.map(&:to_sig).join(', ') end |