Module: Light::Services::Parameters::ClassMethods

Defined in:
lib/light/services/parameters.rb

Instance Method Summary collapse

Instance Method Details

#param(name, options = {}) ⇒ Object



83
84
85
86
87
88
89
90
91
92
# File 'lib/light/services/parameters.rb', line 83

def param(name, options = {})
  self.parameters ||= []
  self.parameters << {
    name:      name,
    required:  options.fetch(:required, true),
    public:    options.fetch(:private, false),
    type:      [*options[:type]].compact,
    allow_nil: options.fetch(:allow_nil, false)
  }
end