Maricvs / TestTask

0 stars 0 forks source link

Update your code #4

Closed Stepandanci closed 4 years ago

Stepandanci commented 4 years ago

1) We recommend you to read the Ruby Style Guide and update your code. https://rubystyle.guide

2) Move class Account to file account.rb Move class Transaction to file transaction.rb Rename file Task.rb to Fibank.rb and include account and transaction file here.

3) Include all code of method noko in 1 class for example (Fibank). Divide your code into specific methods. Separate methods for fetch HTML and for parse it.

Example structure.

class Fibank
  def execute
    connect
    fetch_accounts
    fetch_transactions
    print_result
  end

  def connect

  end

  def fetch_accounts
    parse_accounts(html)
  end

  def fetch_transactions
    accounts.each do |account|
      # go to transactions HTML
      # add transactions to account
      parse_transactions(account, html)
    end
  end

  def parse_accounts(html)

  end

  def parse_transactions(account, html)

  end
end

Fibank.execute

4) Open a new pull request and do not merge it for we can review it.

Good luck.

Stepandanci commented 4 years ago

Please, Open a new pull request for review. No need to finish all tasks, show what you already done and we can help you.

Stepandanci commented 4 years ago

Looks good.

Complete next issue. https://github.com/Maricvs/TestTask/issues/6