Module: Grudge::Sinatra::Helpers
- Defined in:
- lib/grudge/helpers.rb
Instance Method Summary collapse
- #anchor(name, url, options = {}) ⇒ Object
- #repository_name ⇒ Object
- #set_title(msg) ⇒ Object
- #stylesheet_include(name, options = {}) ⇒ Object
- #title ⇒ Object
Instance Method Details
#anchor(name, url, options = {}) ⇒ Object
7 8 9 10 11 |
# File 'lib/grudge/helpers.rb', line 7 def anchor(name, url, ={}) defaults = {:href => url} = hash_to_attributes(defaults.merge()) %Q[<a #{}>#{name}</a>] end |
#repository_name ⇒ Object
20 |
# File 'lib/grudge/helpers.rb', line 20 def repository_name; Grudge::Repository.origin_uri.to_s; end |
#set_title(msg) ⇒ Object
4 |
# File 'lib/grudge/helpers.rb', line 4 def set_title(msg) @title = msg; end |
#stylesheet_include(name, options = {}) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/grudge/helpers.rb', line 13 def stylesheet_include(name, ={}) defaults = {:href => "/stylesheets/#{name}.css", :media => "screen", :rel => "stylesheet", :type => "text/css"} = hash_to_attributes(defaults.merge()) %Q[<link #{}/>] end |
#title ⇒ Object
5 |
# File 'lib/grudge/helpers.rb', line 5 def title; "Grudge - #{@title}"; end |