Class: StrongResources::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/strong_resources/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



5
6
7
8
9
# File 'lib/strong_resources/configuration.rb', line 5

def initialize
  self.strong_resources = {}
  self.strong_params = {}
  define_default_params
end

Instance Attribute Details

#strong_paramsObject

Returns the value of attribute strong_params.



3
4
5
# File 'lib/strong_resources/configuration.rb', line 3

def strong_params
  @strong_params
end

#strong_resourcesObject

Returns the value of attribute strong_resources.



3
4
5
# File 'lib/strong_resources/configuration.rb', line 3

def strong_resources
  @strong_resources
end

Instance Method Details

#strong_param(name, swagger:, type:) ⇒ Object



11
12
13
# File 'lib/strong_resources/configuration.rb', line 11

def strong_param(name, swagger:, type:)
  self.strong_params[name] = { swagger: swagger, type: type }
end

#strong_resource(name, &blk) ⇒ Object



15
16
17
18
# File 'lib/strong_resources/configuration.rb', line 15

def strong_resource(name, &blk)
  resource = { name: name, base: blk }
  self.strong_resources[name] = resource
end