Class: WunderMarkdown::Auth
- Inherits:
-
Object
- Object
- WunderMarkdown::Auth
- Defined in:
- lib/wunder_markdown/auth.rb
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize ⇒ Auth
constructor
A new instance of Auth.
- #save(user, password) ⇒ Object
Constructor Details
#initialize ⇒ Auth
Returns a new instance of Auth.
6 7 8 |
# File 'lib/wunder_markdown/auth.rb', line 6 def initialize @netrc = Netrc.read end |
Instance Method Details
#get ⇒ Object
16 17 18 19 |
# File 'lib/wunder_markdown/auth.rb', line 16 def get _, token = @netrc[API_ENDPOINT] token end |
#save(user, password) ⇒ Object
10 11 12 13 14 |
# File 'lib/wunder_markdown/auth.rb', line 10 def save(user, password) @netrc[API_ENDPOINT] = user, password @netrc.save password end |