class Jahuty::Snippet::Data::Problem

Attributes

detail[RW]
status[RW]
type[RW]

Public Class Methods

from(data) click to toggle source
# File lib/jahuty/snippet/data/problem.rb, line 13
def self.from(data)
  raise ArgumentError.new "Key :status does not exist" if !data.key?(:status)
  raise ArgumentError.new "Key :type does not exist" if !data.key?(:type)
  raise ArgumentError.new "Key :detail does not exist" if !data.key?(:detail)

  Problem.new(data[:status], data[:type], data[:detail])
end
new(status, type, detail) click to toggle source
# File lib/jahuty/snippet/data/problem.rb, line 7
def initialize(status, type, detail)
  @status = status
  @type   = type
  @detail = detail
end