Class: Application

Inherits:
Object
  • Object
show all
Defined in:
lib/ymdp/view/application.rb

Overview

Provides an interface for helper methods to know which view is being rendered so they can branch conditionally.

Class Method Summary collapse

Class Method Details

.current_viewObject

Returns the name of the current view.



13
14
15
# File 'lib/ymdp/view/application.rb', line 13

def self.current_view
  @@current_view
end

.current_view=(view) ⇒ Object

Sets the name of the current view.



19
20
21
# File 'lib/ymdp/view/application.rb', line 19

def self.current_view= view
  @@current_view = view
end

.current_view?(view) ⇒ Boolean

Returns true if view is the current view which is being rendered.

Returns:

  • (Boolean)


7
8
9
# File 'lib/ymdp/view/application.rb', line 7

def self.current_view?(view)
  current_view.downcase == view.downcase
end