Module: Pavlov

Defined in:
lib/pavlov/concern.rb,
lib/pavlov.rb,
lib/pavlov/query.rb,
lib/pavlov/engine.rb,
lib/pavlov/command.rb,
lib/pavlov/helpers.rb,
lib/pavlov/version.rb,
lib/pavlov/operation.rb,
lib/pavlov/interactor.rb,
lib/pavlov/access_denied.rb,
lib/pavlov/alpha_compatibility.rb,
lib/generators/pavlov/install_generator.rb

Overview

fork from active_support 3.2.14 : ActiveSuport::Concern Removed deprecation warning, and don’t include InstanceMethods

Including InstanceMethods conflicts with Virtus (which also uses InstanceMethods)

Defined Under Namespace

Modules: Command, Concern, Helpers, Interactor, Operation, Query, Validations Classes: AccessDenied, Engine, InstallGenerator, ValidationError

Constant Summary collapse

VERSION =

We’re doing this because we might write tests that deal with other versions of bundler and we are unsure how to handle this better.

'0.1.7'

Class Method Summary collapse

Class Method Details

.command(command_name, *args) ⇒ Object



12
13
14
15
# File 'lib/pavlov.rb', line 12

def self.command command_name, *args
  klass = class_for_command(command_name)
  klass.new(*args).call
end

.get_class_by_string(classname) ⇒ Object

this method is also available as constantize in Rails, but we want to be able to write classes and/or tests without Rails



4
5
6
# File 'lib/pavlov.rb', line 4

def self.get_class_by_string classname
  classname.constantize
end

.interactor(interactor_name, *args) ⇒ Object



17
18
19
20
# File 'lib/pavlov.rb', line 17

def self.interactor interactor_name, *args
  klass = class_for_interactor(interactor_name)
  klass.new(*args).call
end

.query(query_name, *args) ⇒ Object



22
23
24
25
# File 'lib/pavlov.rb', line 22

def self.query query_name, *args
  klass = class_for_query(query_name)
  klass.new(*args).call
end

.string_to_classname(string) ⇒ Object



8
9
10
# File 'lib/pavlov.rb', line 8

def self.string_to_classname string
  string.to_s.camelize
end