Class: Apia::DSLs::Argument

Inherits:
Apia::DSL show all
Defined in:
lib/apia/dsls/argument.rb

Instance Method Summary collapse

Methods inherited from Apia::DSL

#description, #initialize, #name, #no_schema

Constructor Details

This class inherits a constructor from Apia::DSL

Instance Method Details

#array(value) ⇒ Object



17
18
19
# File 'lib/apia/dsls/argument.rb', line 17

def array(value)
  @definition.array = value
end

#default(value) ⇒ Object



21
22
23
# File 'lib/apia/dsls/argument.rb', line 21

def default(value)
  @definition.default = value
end

#required(value) ⇒ Object



13
14
15
# File 'lib/apia/dsls/argument.rb', line 13

def required(value)
  @definition.required = value
end

#validation(name, &block) ⇒ Object



9
10
11
# File 'lib/apia/dsls/argument.rb', line 9

def validation(name, &block)
  @definition.validations << { name: name, block: block }
end