Class: Sinatra::FancyViews

Inherits:
Object
  • Object
show all
Defined in:
lib/sinatra/fancyviews.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject

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_scriptsObject



46
47
48
# File 'lib/sinatra/fancyviews.rb', line 46

def included_scripts
  @included_scripts ||= []
end

#included_stylesObject



38
39
40
# File 'lib/sinatra/fancyviews.rb', line 38

def included_styles
  @included_styles ||= []
end