Module: EffectiveStyleGuide

Defined in:
lib/effective_style_guide.rb,
lib/effective_style_guide/engine.rb,
lib/effective_style_guide/version.rb,
lib/generators/effective_style_guide/install_generator.rb

Defined Under Namespace

Modules: Generators Classes: Engine

Constant Summary collapse

VERSION =
'1.3.0'.freeze

Class Method Summary collapse

Class Method Details

.authorized?(controller, action, resource) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
17
18
# File 'lib/effective_style_guide.rb', line 13

def self.authorized?(controller, action, resource)
  if authorization_method.respond_to?(:call) || authorization_method.kind_of?(Symbol)
    raise Effective::AccessDenied.new() unless (controller || self).instance_exec(controller, action, resource, &authorization_method)
  end
  true
end

.colorsObject



20
21
22
# File 'lib/effective_style_guide.rb', line 20

def self.colors
  ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet', 'black', 'white', 'gray']
end

.foodsObject



24
25
26
# File 'lib/effective_style_guide.rb', line 24

def self.foods
  ['Water', 'Tea', 'Coffee', 'Soda']
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



9
10
11
# File 'lib/effective_style_guide.rb', line 9

def self.setup
  yield self
end