Module: Hayde::Helpers

Defined in:
lib/hayde/helpers.rb

Instance Method Summary collapse

Instance Method Details

#author(name, nick, image = 'credits_pic_blank.gif', &block) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/hayde/helpers.rb', line 20

def author(name, nick, image = 'credits_pic_blank.gif', &block)
  image = "images/#{image}"

  result = (:img, nil, :src => image, :class => 'left pic', :alt => name)
  result << (:h3, name)
  result << (:p, capture(&block))
  (:div, result, :class => 'clearfix', :id => nick)
end

#code(&block) ⇒ Object



29
30
31
32
# File 'lib/hayde/helpers.rb', line 29

def code(&block)
  c = capture(&block)
  (:code, c)
end

#guide(name, url, options = {}, &block) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/hayde/helpers.rb', line 3

def guide(name, url, options = {}, &block)
  link = (:a, :href => url) { name }
  result = (:dt, link)

  if ticket = options[:ticket]
    result << (:dd, lh(ticket), :class => 'ticket')
  end

  result << (:dd, capture(&block))
  result
end

#lh(id, label = "Lighthouse Ticket") ⇒ Object



15
16
17
18
# File 'lib/hayde/helpers.rb', line 15

def lh(id, label = "Lighthouse Ticket")
  url = "http://rails.lighthouseapp.com/projects/16213/tickets/#{id}"
  (:a, label, :href => url)
end