Class: Hubstats::Config
- Inherits:
-
Object
- Object
- Hubstats::Config
- Defined in:
- lib/hubstats/config.rb
Class Method Summary collapse
Instance Method Summary collapse
- #assign(attributes) ⇒ Object
- #github_auth ⇒ Object
- #github_config ⇒ Object
-
#initialize(attributes = {}) ⇒ Config
constructor
A new instance of Config.
- #webhook_endpoint ⇒ Object
- #webhook_secret ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Config
Returns a new instance of Config.
6 7 8 |
# File 'lib/hubstats/config.rb', line 6 def initialize(attributes={}) assign attributes end |
Class Method Details
.attributes_from_file ⇒ Object
30 31 32 |
# File 'lib/hubstats/config.rb', line 30 def self.attributes_from_file YAML.load_file("#{Rails.root}/config/octokit.yml") end |
.parse ⇒ Object
26 27 28 |
# File 'lib/hubstats/config.rb', line 26 def self.parse new(attributes_from_file) end |
Instance Method Details
#assign(attributes) ⇒ Object
34 35 36 37 38 |
# File 'lib/hubstats/config.rb', line 34 def assign(attributes) attributes.each do |key, value| self.instance_variable_set("@#{key}", value) end end |
#github_auth ⇒ Object
10 11 12 |
# File 'lib/hubstats/config.rb', line 10 def github_auth @github_auth end |
#github_config ⇒ Object
14 15 16 |
# File 'lib/hubstats/config.rb', line 14 def github_config @github_config end |
#webhook_endpoint ⇒ Object
22 23 24 |
# File 'lib/hubstats/config.rb', line 22 def webhook_endpoint @webhook_endpoint end |
#webhook_secret ⇒ Object
18 19 20 |
# File 'lib/hubstats/config.rb', line 18 def webhook_secret @webhook_secret end |