Module: Cuba::Tools::Api

Extended by:
Api
Included in:
Api
Defined in:
lib/cuba/tools/api.rb

Defined Under Namespace

Modules: Helpers Classes: ValidationError

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject

Returns the value of attribute config.



5
6
7
# File 'lib/cuba/tools/api.rb', line 5

def config
  @config
end

Instance Method Details

#reset_configObject

Resets the configuration to the default (empty hash)



16
17
18
19
20
21
# File 'lib/cuba/tools/api.rb', line 16

def reset_config
  @config = OpenStruct.new({
    path: './app/api_params',
    user_class: 'User'
  })
end

#setup {|config| ... } ⇒ Object

Yields:



7
8
9
# File 'lib/cuba/tools/api.rb', line 7

def setup
  yield config
end