Class: ErrbitPlugin::IssueTracker
- Inherits:
-
Object
- Object
- ErrbitPlugin::IssueTracker
- Defined in:
- lib/errbit_plugin/issue_tracker.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(app, params) ⇒ IssueTracker
constructor
A new instance of IssueTracker.
- #pretty_hash(hash, nesting = 0) ⇒ Object
Constructor Details
#initialize(app, params) ⇒ IssueTracker
Returns a new instance of IssueTracker.
5 6 7 8 |
# File 'lib/errbit_plugin/issue_tracker.rb', line 5 def initialize(app, params) @app = app @params = params end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
3 4 5 |
# File 'lib/errbit_plugin/issue_tracker.rb', line 3 def app @app end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'lib/errbit_plugin/issue_tracker.rb', line 3 def params @params end |
Instance Method Details
#pretty_hash(hash, nesting = 0) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/errbit_plugin/issue_tracker.rb', line 10 def pretty_hash(hash, nesting = 0) tab_size = 2 nesting += 1 pretty = "{" sorted_keys = hash.keys.sort sorted_keys.each do |key| val = hash[key].is_a?(Hash) ? pretty_hash(hash[key], nesting) : hash[key].inspect pretty += "\n#{' '*nesting*tab_size}" pretty += "#{key.inspect} => #{val}" pretty += "," unless key == sorted_keys.last end nesting -= 1 pretty += "\n#{' '*nesting*tab_size}}" end |