Class: StrongResources::Configuration
- Inherits:
-
Object
- Object
- StrongResources::Configuration
- Defined in:
- lib/strong_resources/configuration.rb
Instance Attribute Summary collapse
-
#strong_params ⇒ Object
Returns the value of attribute strong_params.
-
#strong_resources ⇒ Object
Returns the value of attribute strong_resources.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #strong_param(name, swagger:, type:) ⇒ Object
- #strong_resource(name, &blk) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
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_params ⇒ Object
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_resources ⇒ Object
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 |