Method: Endo::Core#param
- Defined in:
- lib/endo/core.rb
#param(key, val = nil, &block) ⇒ Object
TODO: 制限
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/endo/core.rb', line 42 def param(key, val=nil, &block) unless (!val.nil?) ^ (!block.nil?) # Only either one raise ArgumentError.new('DupValue') end @params[key.to_s] = if val val else block.call end end |