Class: Stellar::Horizon::Problem

Inherits:
Object
  • Object
show all
Includes:
Contracts
Defined in:
lib/stellar/horizon/problem.rb

Instance Method Summary collapse

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

#detailObject



32
33
34
# File 'lib/stellar/horizon/problem.rb', line 32

def detail
  @attributes[:detail] 
end

#instanceObject



37
38
39
# File 'lib/stellar/horizon/problem.rb', line 37

def instance
  @attributes[:instance] 
end

#metaObject



42
43
44
# File 'lib/stellar/horizon/problem.rb', line 42

def meta
  @attributes[:instance] 
end

#statusObject



27
28
29
# File 'lib/stellar/horizon/problem.rb', line 27

def status
  @attributes[:status] 
end

#titleObject



22
23
24
# File 'lib/stellar/horizon/problem.rb', line 22

def title
  @attributes[:title] 
end

#typeObject



17
18
19
# File 'lib/stellar/horizon/problem.rb', line 17

def type
  @attributes[:type] 
end