Class: XCPretty::NetrcInteractor

Inherits:
Object
  • Object
show all
Defined in:
lib/xcpretty/reporters/learn.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNetrcInteractor

Returns a new instance of NetrcInteractor.



125
126
127
128
# File 'lib/xcpretty/reporters/learn.rb', line 125

def initialize
  @netrc = Netrc.read
  @username, @user_id = netrc["flatiron-push"]
end

Instance Attribute Details

#netrcObject (readonly)

Returns the value of attribute netrc.



123
124
125
# File 'lib/xcpretty/reporters/learn.rb', line 123

def netrc
  @netrc
end

#user_idObject (readonly)

Returns the value of attribute user_id.



123
124
125
# File 'lib/xcpretty/reporters/learn.rb', line 123

def user_id
  @user_id
end

#usernameObject (readonly)

Returns the value of attribute username.



123
124
125
# File 'lib/xcpretty/reporters/learn.rb', line 123

def username
  @username
end

Instance Method Details

#write(username, user_id) ⇒ Object



130
131
132
133
# File 'lib/xcpretty/reporters/learn.rb', line 130

def write(username, user_id)
  netrc["flatiron-push"] = username, user_id
  netrc.save
end