Class: Muffin::Base
- Inherits:
-
Object
- Object
- Muffin::Base
- Includes:
- ActiveModel::Conversion, ActiveModel::Naming, Attributes, Execution, Policy, Sync, Validation
- Defined in:
- lib/muffin/base.rb
Constant Summary
Constants included from Attributes
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Attributes included from Attributes
Instance Method Summary collapse
-
#initialize(request: nil, params: nil, scope: nil) ⇒ Base
constructor
A new instance of Base.
Methods included from Policy
#attribute_permitted?, #attribute_value_permitted?, included, #permit!, #permit_attribute!, #permitted?, #permitted_values
Methods included from Execution
Methods included from Validation
included, #required_attributes
Methods included from Attributes
#assign_attributes, included, #persisted?, #respond_to_missing?
Constructor Details
#initialize(request: nil, params: nil, scope: nil) ⇒ Base
Returns a new instance of Base.
21 22 23 24 25 26 27 |
# File 'lib/muffin/base.rb', line 21 def initialize(request: nil, params: nil, scope: nil) @request = request @params = params || {} @scope = scope assign_attributes end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
17 18 19 |
# File 'lib/muffin/base.rb', line 17 def params @params end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
17 18 19 |
# File 'lib/muffin/base.rb', line 17 def request @request end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
17 18 19 |
# File 'lib/muffin/base.rb', line 17 def scope @scope end |