Class: Apia::DSLs::Enum

Inherits:
Apia::DSL show all
Defined in:
lib/apia/dsls/enum.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

#cast(&block) ⇒ Object



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

def cast(&block)
  @definition.cast = block
end

#value(name, description = nil) ⇒ Object



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

def value(name, description = nil)
  @definition.values[name.to_s] = { name: name.to_s, description: description }
end