Module: Cell::VersionStrategy::ClassMethods

Defined in:
lib/cell/rails3_0_strategy.rb,
lib/cell/rails3_1_strategy.rb,
lib/cell/rails4_0_strategy.rb,
lib/cell/rails4_1_strategy.rb

Instance Method Summary collapse

Instance Method Details

#cell_nameObject



34
35
36
# File 'lib/cell/rails3_0_strategy.rb', line 34

def cell_name
  controller_path
end

#find_class_view_for_state(state) ⇒ Object

Returns all possible view paths for state by invoking #view_for_state on all classes up the inheritance chain.



28
29
30
31
32
# File 'lib/cell/rails3_0_strategy.rb', line 28

def find_class_view_for_state(state)
  return [view_for_state(state)] if superclass.abstract?

  superclass.find_class_view_for_state(state) << view_for_state(state)
end

#helper_modulesObject



17
18
19
# File 'lib/cell/rails3_0_strategy.rb', line 17

def helper_modules
  [_helpers, _routes.url_helpers]
end

#view_for_state(state) ⇒ Object

Return the default view path for state. Override this if you cell has a differing naming style.



22
23
24
# File 'lib/cell/rails3_0_strategy.rb', line 22

def view_for_state(state)
  "#{cell_name}/#{state}"
end