Module: Apiwork::Introspection::Param

Defined in:
lib/apiwork/introspection/param.rb,
lib/apiwork/introspection/param/base.rb,
lib/apiwork/introspection/param/date.rb,
lib/apiwork/introspection/param/time.rb,
lib/apiwork/introspection/param/uuid.rb,
lib/apiwork/introspection/param/array.rb,
lib/apiwork/introspection/param/union.rb,
lib/apiwork/introspection/param/binary.rb,
lib/apiwork/introspection/param/number.rb,
lib/apiwork/introspection/param/object.rb,
lib/apiwork/introspection/param/record.rb,
lib/apiwork/introspection/param/string.rb,
lib/apiwork/introspection/param/boolean.rb,
lib/apiwork/introspection/param/decimal.rb,
lib/apiwork/introspection/param/integer.rb,
lib/apiwork/introspection/param/literal.rb,
lib/apiwork/introspection/param/unknown.rb,
lib/apiwork/introspection/param/date_time.rb,
lib/apiwork/introspection/param/reference.rb

Defined Under Namespace

Classes: Array, Base, Binary, Boolean, Date, DateTime, Decimal, Integer, Literal, Number, Object, Record, Reference, String, Time, UUID, Union, Unknown

Class Method Summary collapse

Class Method Details

.build(dump) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/apiwork/introspection/param.rb', line 7

def build(dump)
  case dump[:type]
  when :string then String.new(dump)
  when :integer then Integer.new(dump)
  when :number then Number.new(dump)
  when :decimal then Decimal.new(dump)
  when :boolean then Boolean.new(dump)
  when :datetime then DateTime.new(dump)
  when :date then Date.new(dump)
  when :time then Time.new(dump)
  when :uuid then UUID.new(dump)
  when :binary then Binary.new(dump)
  when :unknown then Unknown.new(dump)
  when :array then Array.new(dump)
  when :record then Record.new(dump)
  when :object then Object.new(dump)
  when :union then Union.new(dump)
  when :literal then Literal.new(dump)
  when :reference then Reference.new(dump)
  else Unknown.new(dump)
  end
end