Class: Lasp::Params

Inherits:
Object
  • Object
show all
Defined in:
lib/lasp/params.rb

Direct Known Subclasses

VariadicParams

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(param_list) ⇒ Params

Returns a new instance of Params.



7
8
9
# File 'lib/lasp/params.rb', line 7

def initialize(param_list)
  @param_list = param_list
end

Instance Attribute Details

#param_listObject (readonly)

Returns the value of attribute param_list.



5
6
7
# File 'lib/lasp/params.rb', line 5

def param_list
  @param_list
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/lasp/params.rb', line 11

def to_s
  "(" + param_list.join(" ") + ")"
end

#with_args(args) ⇒ Object



15
16
17
18
# File 'lib/lasp/params.rb', line 15

def with_args(args)
  enforce_arity!(args)
  fixed_params.zip(args.take(length)).to_h
end