Class: WO::Configure
- Inherits:
-
Object
- Object
- WO::Configure
- Defined in:
- lib/wo/configure.rb
Instance Attribute Summary collapse
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#user_name ⇒ Object
readonly
Returns the value of attribute user_name.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Configure
constructor
A new instance of Configure.
- #to_h ⇒ Object
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( = {}) [:token, :repo, :branch, :user_name].each do |key| next unless value = [key] instance_variable_set(:"@#{key}", value) end end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
3 4 5 |
# File 'lib/wo/configure.rb', line 3 def branch @branch end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
3 4 5 |
# File 'lib/wo/configure.rb', line 3 def repo @repo end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
3 4 5 |
# File 'lib/wo/configure.rb', line 3 def token @token end |
#user_name ⇒ Object (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_h ⇒ Object
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 |