Class: Sinatra::FancyViews
- Inherits:
-
Object
- Object
- Sinatra::FancyViews
- Defined in:
- lib/sinatra/fancyviews.rb
Instance Attribute Summary collapse
-
#view_name ⇒ Object
current view.
Instance Method Summary collapse
- #include_script(name, js) ⇒ Object
- #include_style(name, sass) ⇒ Object
- #included_scripts ⇒ Object
- #included_styles ⇒ Object
-
#initialize(app) ⇒ FancyViews
constructor
A new instance of FancyViews.
Constructor Details
#initialize(app) ⇒ FancyViews
Returns a new instance of FancyViews.
30 31 32 |
# File 'lib/sinatra/fancyviews.rb', line 30 def initialize(app) @app = app end |
Instance Attribute Details
#view_name ⇒ Object
current view
28 29 30 |
# File 'lib/sinatra/fancyviews.rb', line 28 def view_name @view_name end |
Instance Method Details
#include_script(name, js) ⇒ Object
42 43 44 |
# File 'lib/sinatra/fancyviews.rb', line 42 def include_script(name, js) included_scripts << [name, js] unless included_scripts.detect { |s| s == [name, js] } end |
#include_style(name, sass) ⇒ Object
34 35 36 |
# File 'lib/sinatra/fancyviews.rb', line 34 def include_style(name, sass) included_styles << [name, sass] unless included_styles.detect { |s| s == [name, sass] } end |
#included_scripts ⇒ Object
46 47 48 |
# File 'lib/sinatra/fancyviews.rb', line 46 def included_scripts @included_scripts ||= [] end |
#included_styles ⇒ Object
38 39 40 |
# File 'lib/sinatra/fancyviews.rb', line 38 def included_styles @included_styles ||= [] end |