Class: Squeegee::BritishGas

Inherits:
Base
  • Object
show all
Defined in:
lib/squeegee/british_gas.rb

Overview

BritishGas - Energy Supplier

  • can have more than one account.

Constant Summary collapse

HOST =
"https://www.britishgas.co.uk"
LOGIN_URL =
"#{HOST}/Login/Login-Verify/"
ACCOUNTS_URL =
"#{HOST}/apps/britishgas/components/GetAccountDetails/GET.servlet"
ACCOUNT_URL =
"#{HOST}/YourAccount/PaymentHistory"
FIELD =
{
  email: "emailAddress",
  password: "password"
}

Instance Attribute Summary collapse

Attributes inherited from Base

#agent, #amount, #due_at, #keys, #paid

Instance Method Summary collapse

Methods inherited from Base

#get, #params

Constructor Details

#initialize(args = {}) ⇒ BritishGas

Returns a new instance of BritishGas.



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/squeegee/british_gas.rb', line 19

def initialize(args = {})
  @keys = %w(email password)

  params(args)
  @email = args.delete(:email)
  @password = args.delete(:password)
  @accounts = []

  authenticate!
  get_accounts
end

Instance Attribute Details

#accountsObject

Returns the value of attribute accounts.



12
13
14
# File 'lib/squeegee/british_gas.rb', line 12

def accounts
  @accounts
end