Class: Bookbinder::BlueGreenApp
- Inherits:
-
Object
- Object
- Bookbinder::BlueGreenApp
- Defined in:
- lib/bookbinder/blue_green_app.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name) ⇒ BlueGreenApp
constructor
A new instance of BlueGreenApp.
- #to_s ⇒ Object
- #with_flipped_name ⇒ Object
Constructor Details
#initialize(name) ⇒ BlueGreenApp
Returns a new instance of BlueGreenApp.
3 4 5 |
# File 'lib/bookbinder/blue_green_app.rb', line 3 def initialize(name) @name = name.strip end |
Instance Method Details
#==(other) ⇒ Object
7 8 9 |
# File 'lib/bookbinder/blue_green_app.rb', line 7 def ==(other) to_s == other.to_s end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/bookbinder/blue_green_app.rb', line 11 def to_s name end |
#with_flipped_name ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/bookbinder/blue_green_app.rb', line 15 def with_flipped_name if name.match(/green$/) BlueGreenApp.new(name.sub(/green$/, 'blue')) else BlueGreenApp.new(name.sub(/blue$/, 'green')) end end |