Class: Squeegee::OrangeUK

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

Overview

OrangeUK - Mobile network

Constant Summary collapse

LOGIN_URL =
"https://web.orange.co.uk/r/login/"
BILLS_URL =
"https://www.youraccount.orange.co.uk/sss/jfn?mfunc=63&jfnRC=1"
LOGIN_POST_URL =
"https://web.orange.co.uk/id/signin.php?rm=StandardSubmit"
FIELD =
{
  username: 'LOGIN',
  password: 'PASSWORD'
}

Instance Attribute Summary collapse

Attributes inherited from Base

#agent, #keys

Instance Method Summary collapse

Methods inherited from Base

#get, #params

Constructor Details

#initialize(args = {}) ⇒ OrangeUK

Returns a new instance of OrangeUK.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/squeegee/orange_uk.rb', line 17

def initialize(args = {})
  @keys = %w(username password)
  @accounts = []

  @agent = Mechanize.new

  # NOTE: Orange websites redirects though insecure servers.
  @agent.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE

  params(args)
  @username = args.delete(:username)
  @password = args.delete(:password)

  authenticate!
  get_statement
end

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



15
16
17
# File 'lib/squeegee/orange_uk.rb', line 15

def 
  @account_id
end

#accountsObject

Returns the value of attribute accounts.



15
16
17
# File 'lib/squeegee/orange_uk.rb', line 15

def accounts
  @accounts
end

#amountObject

Returns the value of attribute amount.



15
16
17
# File 'lib/squeegee/orange_uk.rb', line 15

def amount
  @amount
end

#due_atObject

Returns the value of attribute due_at.



15
16
17
# File 'lib/squeegee/orange_uk.rb', line 15

def due_at
  @due_at
end

Returns the value of attribute paid.



15
16
17
# File 'lib/squeegee/orange_uk.rb', line 15

def paid
  @paid
end