Module: ActsResponsible

Defined in:
lib/acts_responsible.rb,
lib/acts_responsible/core.rb,
lib/acts_responsible/version.rb

Defined Under Namespace

Modules: Core

Constant Summary collapse

VERSION =
"0.0.4"

Instance Method Summary collapse

Instance Method Details

#acts_responsible(prefix) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/acts_responsible.rb', line 11

def acts_responsible(prefix)
  class_attribute :responsible_config

  self.responsible_config = { prefix: prefix }

  return if responsible?

  include ActsResponsible::Core

  append_view_path(File.dirname(__FILE__) + '/acts_responsible/templates')
end

#responsible?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/acts_responsible.rb', line 7

def responsible?
  self.included_modules.include?(ActsResponsible::Core)
end