Class: Tins::MethodDescription::Parameters

Inherits:
Object
  • Object
show all
Defined in:
lib/tins/method_description.rb

Defined Under Namespace

Classes: BlockParameter, GenericParameter, KeyParameter, KeyreqParameter, KeyrestParameter, OptParameter, Parameter, ReqParameter, RestParameter

Class Method Summary collapse

Class Method Details

.build(type, name) ⇒ Object



62
63
64
65
66
67
68
69
70
71
# File 'lib/tins/method_description.rb', line 62

def self.build(type, name)
  parameter_classname = "#{type.to_s.capitalize}Parameter"
  parameter_class =
    if const_defined? parameter_classname
      const_get parameter_classname
    else
      GenericParameter
    end
  parameter_class.new(type, name)
end