Class: ErrbitPlugin::IssueTracker

Inherits:
Object
  • Object
show all
Defined in:
lib/errbit_plugin/issue_tracker.rb

Direct Known Subclasses

FakeIssueTracker, NoneIssueTracker

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#appObject (readonly)

Returns the value of attribute app.



3
4
5
# File 'lib/errbit_plugin/issue_tracker.rb', line 3

def app
  @app
end

#paramsObject (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