Class: RendererDescriber

Inherits:
Object
  • Object
show all
Defined in:
lib/culpa/renderer_describer.rb

Constant Summary collapse

RETURN_CODES =
{
  # Information codes
  continue: 100,
  switching_procotols: 101,
  # Success codes
  ok: 200,
  created: 201,
  accepted: 202,
  non_authoritative_information: 203,
  no_content: 204,
  reset_content: 205,
  partial_content: 206,
  # Redirection codes
  multiple_choices: 300,
  moved_permanently: 301,
  moved_temporarily: 302,
  see_other: 303,
  not_modified: 304,
  use_proxy: 305,
  temporary_redirect: 307,
  permanent_redirect: 308,
  too_many_redirects: 310,
  # Clients error codes
  bad_request: 400,
  unauthorized: 401,
  payment_required: 402,
  forbidden: 403,
  not_found: 404,
  method_not_allowed: 405,
  not_acceptable: 406,
  proxy_authentication_required: 407,
  request_time_out: 408,
  conflict: 409,
  gone: 410,
  length_required: 411,
  precondition_failed: 412,
  request_entity_too_large: 413,
  request_uri_too_long: 414,
  unsupported_media_type: 415,
  request_range_unsatisfiable: 416,
  expectation_failed: 417,
  im_a_tea_pot: 418,
  bad_mapping: 412,
  unavailable_for_legal_reason: 451,
  # Server error codes
  internal_server_error: 500,
  not_implemented: 501,
  bad_gateway: 502,
  proxy_error: 502,
  service_unavailable: 503,
  gateway_time_out: 504,
  bandwidth_limit_exceeded: 509,
  unknown_error: 520
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ RendererDescriber

Returns a new instance of RendererDescriber.



59
60
61
# File 'lib/culpa/renderer_describer.rb', line 59

def initialize(file)
  instance_eval(File.read(file), file)
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



57
58
59
# File 'lib/culpa/renderer_describer.rb', line 57

def result
  @result
end

Instance Method Details

#describe_renderer(keyword, &blk) ⇒ Object



63
64
65
# File 'lib/culpa/renderer_describer.rb', line 63

def describe_renderer(keyword, &blk)
  @result = { keyword => blk }
end