Class: LearnTest::NetrcInteractor
- Inherits:
-
Object
- Object
- LearnTest::NetrcInteractor
- Defined in:
- lib/learn_test/netrc_interactor.rb
Instance Attribute Summary collapse
-
#netrc ⇒ Object
readonly
Returns the value of attribute netrc.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize ⇒ NetrcInteractor
constructor
A new instance of NetrcInteractor.
- #write(username, user_id) ⇒ Object
Constructor Details
#initialize ⇒ NetrcInteractor
Returns a new instance of NetrcInteractor.
7 8 9 10 |
# File 'lib/learn_test/netrc_interactor.rb', line 7 def initialize @netrc = Netrc.read @username, @user_id = netrc["flatiron-push"] end |
Instance Attribute Details
#netrc ⇒ Object (readonly)
Returns the value of attribute netrc.
5 6 7 |
# File 'lib/learn_test/netrc_interactor.rb', line 5 def netrc @netrc end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
5 6 7 |
# File 'lib/learn_test/netrc_interactor.rb', line 5 def user_id @user_id end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
5 6 7 |
# File 'lib/learn_test/netrc_interactor.rb', line 5 def username @username end |
Instance Method Details
#write(username, user_id) ⇒ Object
12 13 14 15 |
# File 'lib/learn_test/netrc_interactor.rb', line 12 def write(username, user_id) netrc["flatiron-push"] = username, user_id netrc.save end |