Class: Bicho::Change
- Inherits:
-
Object
- Object
- Bicho::Change
- Defined in:
- lib/bicho/history.rb
Overview
Represents a single change inside a bug. History has multiple ChangeSets, and they have multiple changes.
Instance Method Summary collapse
- #added ⇒ Object
- #field_name ⇒ Object
-
#initialize(client, data) ⇒ Change
constructor
A new instance of Change.
- #removed ⇒ Object
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(client, data) ⇒ Change
Returns a new instance of Change.
53 54 55 56 |
# File 'lib/bicho/history.rb', line 53 def initialize(client, data) @client = client @data = data end |
Instance Method Details
#added ⇒ Object
42 43 44 |
# File 'lib/bicho/history.rb', line 42 def added @data['added'] end |
#field_name ⇒ Object
34 35 36 |
# File 'lib/bicho/history.rb', line 34 def field_name @data['field_name'] end |
#removed ⇒ Object
38 39 40 |
# File 'lib/bicho/history.rb', line 38 def removed @data['removed'] end |
#to_h ⇒ Object
58 59 60 |
# File 'lib/bicho/history.rb', line 58 def to_h @data end |
#to_s ⇒ Object
46 47 48 49 50 51 |
# File 'lib/bicho/history.rb', line 46 def to_s buffer = StringIO.new buffer << "- #{field_name} = #{removed}\n" buffer << "+ #{field_name} = #{added}" buffer.string end |