Class: Muffin::Base

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Conversion, ActiveModel::Naming, Attributes, Execution, Policy, Sync, Validation
Defined in:
lib/muffin/base.rb

Constant Summary

Constants included from Attributes

Attributes::Boolean

Instance Attribute Summary collapse

Attributes included from Attributes

#attributes

Instance Method Summary collapse

Methods included from Policy

#attribute_permitted?, #attribute_value_permitted?, included, #permit!, #permit_attribute!, #permitted?, #permitted_values

Methods included from Execution

#call, #call!

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

#paramsObject (readonly)

Returns the value of attribute params.



17
18
19
# File 'lib/muffin/base.rb', line 17

def params
  @params
end

#requestObject (readonly)

Returns the value of attribute request.



17
18
19
# File 'lib/muffin/base.rb', line 17

def request
  @request
end

#scopeObject (readonly)

Returns the value of attribute scope.



17
18
19
# File 'lib/muffin/base.rb', line 17

def scope
  @scope
end