class Seldom::Html

Attributes

options[R]

Public Class Methods

new(options={}) click to toggle source
# File lib/seldom/html.rb, line 5
def initialize(options={})
        @options = defaults.merge(options)
end

Public Instance Methods

body() click to toggle source
# File lib/seldom/html.rb, line 9
def body
        "<html><body><h1>Hello, World!</h1>
          <div>#{selector_to_html(options[:nav_selector])}</div>
          <span>#{Faker::Lorem.sentence}<span>
          <div>#{selector_to_html(options[:content_selector])}</div>
        </body></html>"
end
defaults() click to toggle source
# File lib/seldom/html.rb, line 21
def defaults
        { content_selector: '#right-content',
                nav_selector:      '#nav'
        }
end
selector_to_html(selector, tag='div') click to toggle source
# File lib/seldom/html.rb, line 17
def selector_to_html(selector, tag='div')
        "<#{tag} id=#{selector.rpartition('#').pop}>#{::Faker::Lorem.sentence}</#{tag}>"
end