Class: MagnumPI::API::Scheme

Inherits:
DSL
  • Object
show all
Defined in:
lib/magnum-pi/api/scheme.rb

Instance Method Summary collapse

Methods inherited from DSL

#[], #class, #inspect, #slice, #to_hash, #to_s

Constructor Details

#initializeScheme

Returns a new instance of Scheme.



5
6
7
8
9
# File 'lib/magnum-pi/api/scheme.rb', line 5

def initialize
  super
  uri ::String
  format ::Symbol
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MagnumPI::DSL

Instance Method Details

#finalize(params = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/magnum-pi/api/scheme.rb', line 11

def finalize(params = {})
  @types = (types = _types).dup
  @values = (values = _values).dup
  params.each do |name, value|
    process_value name, [value], nil
  end
  to_hash
ensure
  @types = types
  @values = values
end