class WsCee::CauseDetail

Attributes

code[R]
description[R]
documents[R]

Public Class Methods

new(cause_detail_hash) click to toggle source
# File lib/ws_cee_client/cause_detail.rb, line 7
def initialize(cause_detail_hash)
  @code = cause_detail_hash[:code]
  @description = cause_detail_hash[:description]

  @documents = []
  parse_document cause_detail_hash[:document]
rescue NoMethodError
  raise WsCee::ParsingError
end

Private Instance Methods

parse_document(document_hash) click to toggle source
# File lib/ws_cee_client/cause_detail.rb, line 19
def parse_document(document_hash)
  if document_hash.is_a? Array
    @documents = document_hash.collect { |document| Document.new document }
  else
    @documents << Document.new(document_hash)
  end
end