Class: StellarBase::BalancesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/stellar_base/balances_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/stellar_base/balances_controller.rb', line 4

def show
  op = Balances::Operations::Show.(balance: balance_params)

  respond_to do |f|
    f.json do
      if op.success?
        representer = BalanceRepresenter.new(op["model"])
        render json: representer
      else
        render(
          json: errors_from(op),
          status: :unprocessable_entity,
        )
      end
    end
  end
end