Skip to content

Commit 7892f68

Browse files
committed
Make Merchanize DI optional.
For the sake of simplicity, there is no need to provide Mechanize agent upont Memirse object initialization.
1 parent ad9a728 commit 7892f68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: memrise.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ class Memrise
77
LOGIN_URL = 'https://www.memrise.com/login/'
88

99
public
10-
def initialize agent, args = {}
10+
def initialize args = {}
1111
raise 'Username not provided.' unless args[:username]
1212
raise 'Password not provided.' unless args[:password]
1313

14-
@agent = agent
14+
@agent = args[:agent] || Mechanize.new
1515

1616
@username = args[:username]
1717
@password = args[:password]

0 commit comments

Comments
 (0)