Class: Worklog::Configuration::GithubConfig
- Inherits:
-
Object
- Object
- Worklog::Configuration::GithubConfig
- Defined in:
- lib/configuration.rb
Overview
Configuration for Github API access.
Instance Attribute Summary collapse
-
#api_key ⇒ String
The API key for Github access.
-
#username ⇒ String
The Github username.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ GithubConfig
constructor
Initialize with default values, parameters can be overridden via hash.
Constructor Details
#initialize(params = {}) ⇒ GithubConfig
Initialize with default values, parameters can be overridden via hash
66 67 68 69 70 71 72 |
# File 'lib/configuration.rb', line 66 def initialize(params = {}) return if params.nil? params.each do |key, value| instance_variable_set("@#{key}", value) if respond_to?("#{key}=") end end |
Instance Attribute Details
#api_key ⇒ String
Returns The API key for Github access.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/configuration.rb', line 60 class GithubConfig attr_accessor :api_key, :username # Initialize with default values, parameters can be overridden via hash # @example # GithubConfig.new({'api_key' => '123abc', 'username' => 'sample-user'}) def initialize(params = {}) return if params.nil? params.each do |key, value| instance_variable_set("@#{key}", value) if respond_to?("#{key}=") end end end |
#username ⇒ String
Returns The Github username.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/configuration.rb', line 60 class GithubConfig attr_accessor :api_key, :username # Initialize with default values, parameters can be overridden via hash # @example # GithubConfig.new({'api_key' => '123abc', 'username' => 'sample-user'}) def initialize(params = {}) return if params.nil? params.each do |key, value| instance_variable_set("@#{key}", value) if respond_to?("#{key}=") end end end |