Sha256: e845b9aad264eb072a3a5b1c86eaa099e3a0b646db7982ea20943d40f7ae6320

Contents?: true

Size: 571 Bytes

Versions: 18

Compression:

Stored size: 571 Bytes

Contents

# An BasePresenter for ResponseCodes
class Lurker::ResponseCodePresenter < Lurker::BasePresenter
  attr_reader :response_code

  def initialize(response_code, options)
    super(options)
    @response_code = response_code
  end

  def to_html
    <<-EOS
      <div class="response-code">
        <span class="status">
          #{status}
        </span>
        #{description}
      </div>
    EOS
  end

  def successful?
    response_code["successful"]
  end

  def status
    response_code["status"]
  end

  def description
    response_code["description"]
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
lurker-1.0.0 lib/lurker/presenters/response_code_presenter.rb
lurker-0.6.12 lib/lurker/presenters/response_code_presenter.rb
lurker-0.6.11 lib/lurker/presenters/response_code_presenter.rb
lurker-0.6.10 lib/lurker/presenters/response_code_presenter.rb
lurker-0.6.9 lib/lurker/presenters/response_code_presenter.rb
lurker-0.6.8 lib/lurker/presenters/response_code_presenter.rb
lurker-0.6.7 lib/lurker/presenters/response_code_presenter.rb
lurker-0.6.6 lib/lurker/presenters/response_code_presenter.rb
lurker-0.6.5 lib/lurker/presenters/response_code_presenter.rb
lurker-0.6.4 lib/lurker/presenters/response_code_presenter.rb
lurker-0.6.3 lib/lurker/presenters/response_code_presenter.rb
lurker-0.6.2 lib/lurker/presenters/response_code_presenter.rb
lurker-0.6.1 lib/lurker/presenters/response_code_presenter.rb
lurker-0.5.7 lib/lurker/presenters/response_code_presenter.rb
lurker-0.6.0 lib/lurker/presenters/response_code_presenter.rb
lurker-0.5.6 lib/lurker/presenters/response_code_presenter.rb
lurker-0.5.5 lib/lurker/presenters/response_code_presenter.rb
lurker-0.5.4 lib/lurker/presenters/response_code_presenter.rb