def deserialize_account(account_json)
      FioAPI::Account.new(
        account_id:       account_json.try_path('accountId'),
        bank_id:          account_json.try_path('bankId'),
        currency:         account_json.try_path('currency'),
        iban:             account_json.try_path('iban'),
        bic:              account_json.try_path('bic'),
        opening_balance:  account_json.try_path('openingBalance'),
        closing_balance:  account_json.try_path('closingBalance'),
        date_start:       account_json.try_path('dateStart'),
        date_end:         account_json.try_path('dateEnd'),
        year_list:        account_json.try_path('yearList'),
        id_list:          account_json.try_path('idList'),
        id_from:          account_json.try_path('idFrom'),
        id_to:            account_json.try_path('idTo'),
        id_last_download: account_json.try_path('idLastDownload')
      )
    end
Similar code snippets
1.
Match rating: 59.01% · See similar code snippets
ruby logo
def deserialize_import(response_json)
      return FioAPI::Payments::Status.new(error_code: 500) unless response_json
      FioAPI::Payments::Status.new(
        error_code: response_json.try_path('errorCode').to_i,
        error_message: response_json.try_path('message').to_s,
        id_instruction: response_json.try_path('idInstruction').to_i,
        sum_credit: response_json.try_path('sums', 'sum', 'sumCredit').to_f,
        sum_debet: response_json.try_path('sums', 'sum', 'sumDebet').to_f
      )
    end
2.
Match rating: 55.18% · See similar code snippets
ruby logo
def deserialize(json)
      self.account = deserialize_account(json.try_path('accountStatement', 'info'))
      self.transactions = deserialize_transactions(json.try_path('accountStatement', 'transactionList', 'transaction'))
      self
    end
3.
cloudfoundry/bosh · instance.rb
Match rating: 46.72% · See similar code snippets
ruby logo
def spec
      return nil if spec_json.nil?

      begin
        result = JSON.parse(spec_json)
      rescue JSON::ParserError
        return 'error'
      end

      result
    end
4.
plaid/plaid-ruby · accounts.rb
Match rating: 46.67% · See similar code snippets
ruby logo
def get(access_token, account_ids: nil, options: nil)
      post_with_auth 'accounts/balance/get',
                     AccountsResponse,
                     build_payload(access_token,
                                   account_ids: account_ids,
                                   options: options)
    end
5.
rafaelmillan/ynaby · budget.rb
Match rating: 46.47% · See similar code snippets
ruby logo
def account(account_id)
      response = ynab_client.accounts.get_account_by_id(id, account_id)
      Account.parse(object: response.data.account, budget: self)
    end
6.
Samsinite/filter_me · accounts.rb
Match rating: 46.43% · See similar code snippets
ruby logo
def load_accounts
			Account.create! do |account|
				account.cost = 10000
			end

			Account.create! do |account|
				account.cost = 50000
			end

			Account.create! do |account|
				account.cost = 100000
			end
		end
7.
rafaelmillan/ynaby · budget.rb
Match rating: 46.07% · See similar code snippets
ruby logo
def accounts
      response = ynab_client.accounts.get_accounts(@id)
      response.data.accounts.map do |account|
        Account.parse(object: account, budget: self)
      end
    end
8.
aptible/opsworks-cli · stack.rb
Match rating: 46.03% · See similar code snippets
ruby logo
def set_custom_json_at(key, value)
      self.custom_json = replace_hash_at_path(custom_json, key, value)

      client.update_stack(
        stack_id: id,
        custom_json: JSON.pretty_generate(custom_json)
      )
    end
9.
blockstack/blockstack-ruby · user.rb
Match rating: 45.43% · See similar code snippets
ruby logo
def find_account(json, service)
      accounts = json['account']
      if accounts && accounts.is_a?(Array)
        accounts.each do |account|
          return account if account['service'] == service
        end
      end
      nil
    end
10.
preact/preact-ruby · client.rb
Match rating: 45.39% · See similar code snippets
ruby logo
def update_account(account)

      params = {
        :account => Preact.configuration.prepare_account_hash(account)
      }

      data = post_request("/accounts", params)
    end