Class: Buildmeister::Bin
- Inherits:
-
Object
- Object
- Buildmeister::Bin
- Extended by:
- Forwardable
- Defined in:
- lib/buildmeister/bin.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
Returns the value of attribute annotations.
-
#bin ⇒ Object
Returns the value of attribute bin.
-
#last_value ⇒ Object
Returns the value of attribute last_value.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #changed? ⇒ Boolean
- #display ⇒ Object
-
#initialize(lighthouse_bin, mode = :verbose, options = {}) ⇒ Bin
constructor
A new instance of Bin.
- #refresh! ⇒ Object
Constructor Details
#initialize(lighthouse_bin, mode = :verbose, options = {}) ⇒ Bin
Returns a new instance of Bin.
12 13 14 15 16 17 18 |
# File 'lib/buildmeister/bin.rb', line 12 def initialize(lighthouse_bin, mode = :verbose, = {}) self.bin = lighthouse_bin self.mode = mode self.annotations = [:annotations] || {} refresh! end |
Instance Attribute Details
#annotations ⇒ Object
Returns the value of attribute annotations.
6 7 8 |
# File 'lib/buildmeister/bin.rb', line 6 def annotations @annotations end |
#bin ⇒ Object
Returns the value of attribute bin.
6 7 8 |
# File 'lib/buildmeister/bin.rb', line 6 def bin @bin end |
#last_value ⇒ Object
Returns the value of attribute last_value.
6 7 8 |
# File 'lib/buildmeister/bin.rb', line 6 def last_value @last_value end |
#mode ⇒ Object
Returns the value of attribute mode.
6 7 8 |
# File 'lib/buildmeister/bin.rb', line 6 def mode @mode end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/buildmeister/bin.rb', line 6 def value @value end |
Instance Method Details
#changed? ⇒ Boolean
41 42 43 |
# File 'lib/buildmeister/bin.rb', line 41 def changed? value != last_value end |
#display ⇒ Object
37 38 39 |
# File 'lib/buildmeister/bin.rb', line 37 def display "#{name}: #{value}" end |
#refresh! ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/buildmeister/bin.rb', line 20 def refresh! self.last_value = value case mode when :verbose self.value = bin.tickets.map do |tkt| str = "#{tkt.id}" annotations.each do |tag_name, identifier| str << identifier if tkt..include?(tag_name) end str end.join(', ') when :quiet self.value = bin.tickets_count end end |