File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ class Client
1616
1717 attr_accessor :access_token , :api_key , :account_id
1818
19- def initialize
19+ def initialize ( options = { } )
20+ @account_id = options [ :account_id ]
21+ @access_token = options [ :access_token ]
22+ @api_key = options [ :api_key ]
2023 yield ( self ) if block_given?
2124 end
2225
Original file line number Diff line number Diff line change @@ -26,6 +26,18 @@ class Drip::ClientTest < Drip::TestCase
2626
2727 assert_equal "1234567" , client . account_id
2828 end
29+
30+ should "accept options via arguments" do
31+ client = Drip ::Client . new (
32+ account_id : "1234567" ,
33+ api_key : "aaaa" ,
34+ access_token : "bbbb"
35+ )
36+
37+ assert_equal "1234567" , client . account_id
38+ assert_equal "aaaa" , client . api_key
39+ assert_equal "bbbb" , client . access_token
40+ end
2941 end
3042
3143 context "#generate_resource" do
You can’t perform that action at this time.
0 commit comments