Sha256: fd8fe91c27330d0cfc2084644343aa64337820dbe8154bdac7541a3599e3c959

Contents?: true

Size: 508 Bytes

Versions: 72

Compression:

Stored size: 508 Bytes

Contents

# Provides an interface for helper methods to know which view is being rendered so they
# can branch conditionally.
#
class Application
  # Returns true if <tt>view</tt> is the current view which is being rendered.
  #
  def self.current_view?(view)
    current_view.downcase == view.downcase
  end
  
  # Returns the name of the current view.
  #
  def self.current_view
    @@current_view
  end
  
  # Sets the name of the current view.
  #
  def self.current_view= view
    @@current_view = view
  end
end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
ymdp-1.4.7 lib/ymdp/view/application.rb
ymdp-1.4.6 lib/ymdp/view/application.rb
ymdp-1.4.5 lib/ymdp/view/application.rb
ymdp-1.4.4 lib/ymdp/view/application.rb
ymdp-1.4.3 lib/ymdp/view/application.rb
ymdp-1.4.2 lib/ymdp/view/application.rb
ymdp-1.4.1 lib/ymdp/view/application.rb
ymdp-1.4.0 lib/ymdp/view/application.rb
ymdp-1.3.4 lib/ymdp/view/application.rb
ymdp-1.3.3 lib/ymdp/view/application.rb
ymdp-1.3.2 lib/ymdp/view/application.rb
ymdp-1.3.1 lib/ymdp/view/application.rb
ymdp-1.3.0 lib/ymdp/view/application.rb
ymdp-1.2.0 lib/ymdp/view/application.rb
ymdp-1.1.0 lib/ymdp/view/application.rb
ymdp-1.0.1 lib/ymdp/view/application.rb
ymdp-1.0.0 lib/ymdp/view/application.rb
ymdp-0.10.2 lib/ymdp/view/application.rb
ymdp-0.10.1 lib/ymdp/view/application.rb
ymdp-0.10.0 lib/ymdp/view/application.rb