Class: Gelauto::ArgList

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/gelauto/arg_list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#argsObject (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

Returns:

  • (Boolean)


19
20
21
# File 'lib/gelauto/arg_list.rb', line 19

def empty?
  args.empty?
end

#to_sigObject



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