class StrongResources::Configuration
Attributes
strong_params[RW]
strong_resources[RW]
Public Class Methods
new()
click to toggle source
# File lib/strong_resources/configuration.rb, line 5 def initialize self.strong_resources = {} self.strong_params = {} define_default_params end
Public Instance Methods
strong_param(name, swagger:, type:)
click to toggle source
# 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)
click to toggle source
# File lib/strong_resources/configuration.rb, line 15 def strong_resource(name, &blk) resource = { name: name, base: blk } self.strong_resources[name] = resource end
Private Instance Methods
define_default_params()
click to toggle source
# File lib/strong_resources/configuration.rb, line 22 def define_default_params strong_param :id, swagger: :string, type: ActionController::Parameters.string strong_param :string, swagger: :string, type: ActionController::Parameters.string strong_param :integer, swagger: :integer, type: ActionController::Parameters.integer strong_param :boolean, swagger: :boolean, type: ActionController::Parameters.boolean strong_param :number, swagger: :number, type: ActionController::Parameters.decimal end