Class: WO::Configure

Inherits:
Object
  • Object
show all
Defined in:
lib/wo/configure.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Configure

Returns a new instance of Configure.



5
6
7
8
9
10
# File 'lib/wo/configure.rb', line 5

def initialize(options = {})
  [:token, :repo, :branch, :user_name].each do |key|
    next unless value = options[key]
    instance_variable_set(:"@#{key}", value)
  end
end

Instance Attribute Details

#branchObject (readonly)

Returns the value of attribute branch.



3
4
5
# File 'lib/wo/configure.rb', line 3

def branch
  @branch
end

#repoObject (readonly)

Returns the value of attribute repo.



3
4
5
# File 'lib/wo/configure.rb', line 3

def repo
  @repo
end

#tokenObject (readonly)

Returns the value of attribute token.



3
4
5
# File 'lib/wo/configure.rb', line 3

def token
  @token
end

#user_nameObject (readonly)

Returns the value of attribute user_name.



3
4
5
# File 'lib/wo/configure.rb', line 3

def user_name
  @user_name
end

Instance Method Details

#to_hObject



12
13
14
15
16
17
18
19
# File 'lib/wo/configure.rb', line 12

def to_h
  {
    "organization[token]" => @token,
    "doing[repo]"         => @repo,
    "doing[branch]"       => @branch,
    "user[name]"          => @user_name,
  }
end