Class: Porch::HumanError

Inherits:
Object
  • Object
show all
Defined in:
lib/porch/human_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors, seperator = ", ") ⇒ HumanError

Returns a new instance of HumanError.



6
7
8
9
# File 'lib/porch/human_error.rb', line 6

def initialize(errors, seperator=", ")
  @errors = errors
  @seperator = seperator
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



4
5
6
# File 'lib/porch/human_error.rb', line 4

def errors
  @errors
end

#seperatorObject

Returns the value of attribute seperator.



3
4
5
# File 'lib/porch/human_error.rb', line 3

def seperator
  @seperator
end

Instance Method Details

#messageObject



11
12
13
# File 'lib/porch/human_error.rb', line 11

def message
  collect_messages(errors).join(seperator)
end