Class: Mbanker::Account
- Inherits:
-
Object
- Object
- Mbanker::Account
- Defined in:
- lib/mbanker/account.rb
Instance Attribute Summary collapse
-
#account_type ⇒ Object
readonly
Returns the value of attribute account_type.
-
#available_money ⇒ Object
readonly
Returns the value of attribute available_money.
-
#balance ⇒ Object
readonly
Returns the value of attribute balance.
-
#bic_number ⇒ Object
readonly
Returns the value of attribute bic_number.
-
#client_role ⇒ Object
readonly
Returns the value of attribute client_role.
-
#iban_number ⇒ Object
readonly
Returns the value of attribute iban_number.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#plenipotentiary ⇒ Object
readonly
Returns the value of attribute plenipotentiary.
Instance Method Summary collapse
- #change_name(new_name) ⇒ Object
- #fetch_details ⇒ Object
-
#initialize(index, crawler, attributes) ⇒ Account
constructor
A new instance of Account.
Constructor Details
#initialize(index, crawler, attributes) ⇒ Account
Returns a new instance of Account.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/mbanker/account.rb', line 6 def initialize index, crawler, attributes @index, @crawler = index, crawler if attributes.key? :full_name_and_number extract_label_name_and_number attributes[:full_name_and_number] end [:balance, :available_money].each do |attribute_name| if attributes.key? attribute_name instance_variable_set(:"@#{attribute_name}", attributes[attribute_name]) end end end |
Instance Attribute Details
#account_type ⇒ Object (readonly)
Returns the value of attribute account_type.
3 4 5 |
# File 'lib/mbanker/account.rb', line 3 def account_type @account_type end |
#available_money ⇒ Object (readonly)
Returns the value of attribute available_money.
4 5 6 |
# File 'lib/mbanker/account.rb', line 4 def available_money @available_money end |
#balance ⇒ Object (readonly)
Returns the value of attribute balance.
4 5 6 |
# File 'lib/mbanker/account.rb', line 4 def balance @balance end |
#bic_number ⇒ Object (readonly)
Returns the value of attribute bic_number.
3 4 5 |
# File 'lib/mbanker/account.rb', line 3 def bic_number @bic_number end |
#client_role ⇒ Object (readonly)
Returns the value of attribute client_role.
4 5 6 |
# File 'lib/mbanker/account.rb', line 4 def client_role @client_role end |
#iban_number ⇒ Object (readonly)
Returns the value of attribute iban_number.
3 4 5 |
# File 'lib/mbanker/account.rb', line 3 def iban_number @iban_number end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
3 4 5 |
# File 'lib/mbanker/account.rb', line 3 def index @index end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
3 4 5 |
# File 'lib/mbanker/account.rb', line 3 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/mbanker/account.rb', line 3 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
3 4 5 |
# File 'lib/mbanker/account.rb', line 3 def number @number end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
4 5 6 |
# File 'lib/mbanker/account.rb', line 4 def owner @owner end |
#plenipotentiary ⇒ Object (readonly)
Returns the value of attribute plenipotentiary.
4 5 6 |
# File 'lib/mbanker/account.rb', line 4 def plenipotentiary @plenipotentiary end |
Instance Method Details
#change_name(new_name) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/mbanker/account.rb', line 18 def change_name new_name visit_account_details @crawler.click @crawler.get_form.tbVarPartAccName = new_name @crawler.click end |
#fetch_details ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/mbanker/account.rb', line 26 def fetch_details visit_account_details extract_label_and_name @crawler.extract_text('fieldset:nth-child(2) .content') @number = @crawler.extract_text('fieldset:nth-child(3) .content') @iban_number = @crawler.extract_text('fieldset:nth-child(4) .content') @bic_number = @crawler.extract_text('fieldset:nth-child(5) .content') @account_type = @crawler.extract_text('fieldset:nth-child(6) .content') @owner = @crawler.extract_text('fieldset:nth-child(7) li') @plenipotentiary = @crawler.extract_text('fieldset:nth-child(8) li') @client_role = @crawler.extract_text('fieldset:nth-child(9) .content') @balance = @crawler.extract_text('fieldset:nth-child(10) .amount') @available_money = @crawler.extract_text('fieldset:nth-child(11) .amount') end |