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.2.0 lib/ymdp/view/application.rb
ymdp-0.1.15 lib/ymdp/view/application.rb
ymdp-0.1.14 lib/ymdp/view/application.rb
ymdp-0.1.13 lib/ymdp/view/application.rb
ymdp-0.1.12 lib/ymdp/view/application.rb
ymdp-0.1.11 lib/ymdp/view/application.rb
ymdp-0.1.10 lib/ymdp/application.rb
ymdp-0.1.9 lib/ymdp/application.rb
ymdp-0.1.8.1 lib/ymdp/application.rb
ymdp-0.1.8 lib/ymdp/application.rb
ymdp-0.1.7 lib/ymdp/application.rb
ymdp-0.1.6 lib/ymdp/application.rb