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-0.9.2 lib/ymdp/view/application.rb
ymdp-0.9.1 lib/ymdp/view/application.rb
ymdp-0.9.0 lib/ymdp/view/application.rb
ymdp-0.8.8 lib/ymdp/view/application.rb
ymdp-0.8.7 lib/ymdp/view/application.rb
ymdp-0.8.6 lib/ymdp/view/application.rb
ymdp-0.8.5 lib/ymdp/view/application.rb
ymdp-0.8.4 lib/ymdp/view/application.rb
ymdp-0.8.3 lib/ymdp/view/application.rb
ymdp-0.8.2 lib/ymdp/view/application.rb
ymdp-0.8.1 lib/ymdp/view/application.rb
ymdp-0.8.0 lib/ymdp/view/application.rb
ymdp-0.7.7 lib/ymdp/view/application.rb
ymdp-0.7.6 lib/ymdp/view/application.rb
ymdp-0.7.5 lib/ymdp/view/application.rb
ymdp-0.7.4 lib/ymdp/view/application.rb
ymdp-0.7.3 lib/ymdp/view/application.rb
ymdp-0.7.2 lib/ymdp/view/application.rb
ymdp-0.7.1 lib/ymdp/view/application.rb
ymdp-0.7.0 lib/ymdp/view/application.rb