Class: Valanga::Client

Inherits:
Object
  • Object
show all
Includes:
MusicSearch
Defined in:
lib/valanga/client.rb

Constant Summary collapse

LOGIN_PAGE =
"https://p.eagate.573.jp/gate/p/login.html"

Constants included from MusicSearch

MusicSearch::MUSIC_INDEX

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from MusicSearch

#[], #list_musics

Constructor Details

#initialize(username, password) ⇒ Client

Returns a new instance of Client.



12
13
14
15
16
17
18
19
20
# File 'lib/valanga/client.rb', line 12

def initialize(username, password)
  Capybara.register_driver :poltergeist do |app|
    Capybara::Poltergeist::Driver.new(app, js_errors: false)
  end

  @session = Capybara::Session.new(:poltergeist)

  login!(username, password)
end

Instance Attribute Details

#sessionObject (readonly)

Returns the value of attribute session.



10
11
12
# File 'lib/valanga/client.rb', line 10

def session
  @session
end