Class: LgPodPlugin::Command::Init

Inherits:
LgPodPlugin::Command show all
Defined in:
lib/command/init.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LgPodPlugin::Command

options, run

Constructor Details

#initialize(argv) ⇒ Init

Returns a new instance of Init.



18
19
20
21
22
23
# File 'lib/command/init.rb', line 18

def initialize(argv)
  self.host = argv.option('host')
  self.username = argv.option('username')
  self.password = argv.option('password')
  super
end

Instance Attribute Details

#hostObject

Returns the value of attribute host.



12
13
14
# File 'lib/command/init.rb', line 12

def host
  @host
end

#passwordObject

Returns the value of attribute password.



11
12
13
# File 'lib/command/init.rb', line 11

def password
  @password
end

#usernameObject

Returns the value of attribute username.



10
11
12
# File 'lib/command/init.rb', line 10

def username
  @username
end

Instance Method Details

#runObject



25
26
27
28
29
30
# File 'lib/command/init.rb', line 25

def run
  raise unless self.host
  raise unless self.username
  raise unless self.password
  GitLabAPI.request_gitlab_access_token(self.host, self.username, self.password)
end