Class: ActiveInteractor::Context::Base

Inherits:
OpenStruct
  • Object
show all
Extended by:
Attributes::ClassMethods
Includes:
Attributes, Errors, Status, ActiveModel::Attributes, ActiveModel::Validations
Defined in:
lib/active_interactor/context/base.rb

Overview

The base context class all context objects should inherit from.

Author:

Since:

  • 0.1.0

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

Class Method Details

.attribute(name, type = Type::Value.new, **options) ⇒ Object

Examples:

Setting default values on the context class

class MyContext < ActiveInteractor::Context::Base
  attribute :first_name, default: -> { 'Aaron' }
end

MyContext.new
#=> <#MyContext first_name='Aaron'>

MyContext.new(first_name: 'Bob')
#=> <#MyContext first_name='Bob'>

See Also:

Since:

  • 1.0.1



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.attribute_method?(attribute) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.attribute_missing(match, *args, &block) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.attribute_namesObject



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.attributes(*attributes) ⇒ Array<Symbol> Originally defined in module Attributes::ClassMethods

Get or set attributes on a context class

Examples:

Set attributes on a context class

class MyContext < ActiveInteractor::Context::Base
  attributes :first_name, :last_name
end

Get attributes defined on a context class

MyContext.attributes
#=> [:first_name, :last_name]

Set defaults for attributes on a context class

class MyContext < ActiveInteractor::Context::Base
  attributes first_name: { default: -> { 'Aaron' } }, last_name: { default: -> { 'Allen' } }
end

Returns:

  • (Array<Symbol>)

    the defined attributes

Since:

  • 0.1.4

.clear_validators!(attribute) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.method_missing(method, *args, &block) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.respond_to?(method, include_private_methods = false) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.respond_to_without_attributes?(method, include_private_methods = false) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validate(*args, &block) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validates(*attributes) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validates!(*attributes) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validates_absence_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validates_acceptance_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validates_confirmation_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validates_each(*attr_names, &block) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validates_exclusion_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validates_format_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validates_inclusion_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validates_length_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validates_numericality_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validates_presence_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validates_size_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validates_with(*args, &block) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validatorsObject



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

.validators_on(*attributes) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

Instance Method Details

#[](name) ⇒ Object Originally defined in module Attributes

Returns the value of an attribute

Parameters:

  • name (String, Symbol)

    the key of the value to be returned

Since:

  • 1.0.5

#[]=(name, value) ⇒ Object Originally defined in module Attributes

Sets value of a Hash attribute in context.attributes

Parameters:

  • name (String, Symbol)

    the key name of the attribute

  • value (*)

    the value to be given attribute name

Since:

  • 1.1.0

#attribute?(attr_name) ⇒ Boolean Also known as: has_attribute? Originally defined in module Attributes

Check if the context instance has an attribute

Parameters:

  • attr_name (Symbol, String)

    the name of the attribute to check

Returns:

  • (Boolean)

    whether or not the context instance has the attribute

Since:

  • 1.0.1

#attribute_missing(match, *args, &block) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#attribute_namesObject



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#attributesHash{Symbol => *} Originally defined in module Attributes

Get values defined on the instance of context whose keys are defined on the context class' .attributes

Examples:

Get attributes defined on an instance of context

class MyContext < ActiveInteractor::Context::Base
  attributes :first_name, :last_name
end

context = MyContext.new(first_name: 'Aaron', last_name: 'Allen', occupation: 'Ruby Nerd')
#=> <#MyContext first_name='Aaron' last_name='Allen' occupation='Ruby Nerd')

context.attributes
#=> { first_name: 'Aaron', last_name: 'Allen' }

context.occupation
#=> 'Ruby Nerd'

Returns:

  • (Hash{Symbol => *})

    the defined attributes and values

Since:

  • 0.1.4

#called!(interactor) ⇒ Array<Class> Originally defined in module Status

Add an instance of interactor to the list of interactors called on the context. This list is used when #rollback! is called on a context instance.

Parameters:

Returns:

Since:

  • 0.1.0

#errorsObject

See Also:

Since:

  • 0.1.0



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#fail!(errors = nil) ⇒ Object Originally defined in module Status

Fail the context instance. Failing an instance raises an error that may be rescued by the calling interactor. The instance is also flagged as having failed.

Examples:

Fail an interactor context

class MyInteractor < ActiveInteractor::Base
  def perform
    context.fail!
  end
end

MyInteractor.perform!
ActiveInteractor::Error::ContextFailure "<#MyInteractor::Context>"

Parameters:

  • errors (ActiveModel::Errors, String) (defaults to: nil)

    error messages for the failure

Raises:

See Also:

Since:

  • 0.1.0

#failure?Boolean Also known as: fail? Originally defined in module Status

Note:

The #failure? method is the inverse of the #success? method

Whether the context instance has failed. By default, a new instance is successful and only changes when explicitly failed.

Examples:

Check if a context has failed

result = MyInteractor.perform
result.failure?
#=> false

Returns:

  • (Boolean)

    false by default or true if failed.

Since:

  • 0.1.0

#failure_errorsActiveModel::Errors Originally defined in module Errors

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Generic errors generated outside of validation.

Returns:

  • (ActiveModel::Errors)

    an instance of ActiveModel::Errors

Since:

  • 1.0.3

#initialize(context = {}) ⇒ Base Originally defined in module Attributes

Initialize a new instance of Base

Parameters:

  • context (Hash, Base, Class) (defaults to: {})

    attributes to assign to the context

Returns:

Since:

  • 0.1.4

#invalid?(context = nil) ⇒ Object

See Also:

Since:

  • 0.1.0



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#merge!(context) ⇒ self Originally defined in module Attributes

Merge an instance of context into the calling context instance

Examples:

context = MyContext.new(first_name: 'Aaron', last_name: 'Allen')
other_context = MyContext.new(last_name: 'Awesome')
context.merge!(other_context)
#=> <#MyContext first_name='Aaron' last_name='Awesome'>

Parameters:

  • context (Class)

    a context instance to be merged

Returns:

Since:

  • 1.0.0

#resolveself Originally defined in module Status

Resolve an instance of context. Called when an interactor is finished with it's context.

Returns:

  • (self)

    the instance of context

Since:

  • 1.0.3

#respond_to?(method, include_private_methods = false) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#respond_to_without_attributes?(method, include_private_methods = false) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#rollback!Boolean Originally defined in module Status

Rollback an instance of context. Any interactors the instance has been passed via the #called! method are asked to roll themselves back by invoking their #rollback methods. The instance is also flagged as rolled back.

Returns:

Since:

  • 0.1.0

#success?Boolean Also known as: successful? Originally defined in module Status

Note:

The #success? method is the inverse of the #failure? method

Whether the context instance is successful. By default, a new instance is successful and only changes when explicitly failed.

Examples:

Check if a context has failed

result = MyInteractor.perform
result.success?
#=> true

Returns:

  • (Boolean)

    true by default or false if failed

Since:

  • 0.1.0

#valid?(context = nil) ⇒ Object

See Also:

Since:

  • 0.1.0



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#validate(context = nil) ⇒ Object

See Also:

Since:

  • 0.1.0



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#validate!(context = nil) ⇒ Object

See Also:

Since:

  • 0.1.0



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#validates_absence_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#validates_acceptance_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#validates_confirmation_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#validates_exclusion_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#validates_format_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#validates_inclusion_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#validates_length_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#validates_numericality_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#validates_presence_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#validates_size_of(*attr_names) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end

#validates_with(*args, &block) ⇒ Object



323
324
325
326
327
328
329
330
331
# File 'lib/active_interactor/context/base.rb', line 323

class Base < OpenStruct
  extend ActiveInteractor::Context::Attributes::ClassMethods

  include ActiveModel::Attributes
  include ActiveModel::Validations
  include ActiveInteractor::Context::Attributes
  include ActiveInteractor::Context::Errors
  include ActiveInteractor::Context::Status
end