Class: Stellar::Horizon::Problem
- Inherits:
-
Object
- Object
- Stellar::Horizon::Problem
- Includes:
- Contracts
- Defined in:
- lib/stellar/horizon/problem.rb
Instance Method Summary collapse
- #detail ⇒ Object
-
#initialize(attributes) ⇒ Problem
constructor
A new instance of Problem.
- #instance ⇒ Object
- #meta ⇒ Object
- #status ⇒ Object
- #title ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Problem
Returns a new instance of Problem.
6 7 8 9 10 11 12 13 14 |
# File 'lib/stellar/horizon/problem.rb', line 6 def initialize(attributes) @attributes = attributes.reverse_merge({ type: "about:blank", title: "Unknown Error", status: 500, }) @meta = @attributes.except!(:type, :title, :status, :detail, :instance) end |
Instance Method Details
#detail ⇒ Object
32 33 34 |
# File 'lib/stellar/horizon/problem.rb', line 32 def detail @attributes[:detail] end |
#instance ⇒ Object
37 38 39 |
# File 'lib/stellar/horizon/problem.rb', line 37 def instance @attributes[:instance] end |
#meta ⇒ Object
42 43 44 |
# File 'lib/stellar/horizon/problem.rb', line 42 def @attributes[:instance] end |
#status ⇒ Object
27 28 29 |
# File 'lib/stellar/horizon/problem.rb', line 27 def status @attributes[:status] end |
#title ⇒ Object
22 23 24 |
# File 'lib/stellar/horizon/problem.rb', line 22 def title @attributes[:title] end |
#type ⇒ Object
17 18 19 |
# File 'lib/stellar/horizon/problem.rb', line 17 def type @attributes[:type] end |