Class: Twigg::Gerrit::Change
- Inherits:
-
Object
- Object
- Twigg::Gerrit::Change
- Defined in:
- lib/twigg-gerrit/gerrit/change.rb
Instance Attribute Summary collapse
-
#change_id ⇒ Object
readonly
Returns the value of attribute change_id.
-
#full_name ⇒ Object
readonly
Returns the value of attribute full_name.
-
#last_updated_on ⇒ Object
readonly
Returns the value of attribute last_updated_on.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Change
constructor
A new instance of Change.
- #url ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Change
Returns a new instance of Change.
22 23 24 25 26 27 |
# File 'lib/twigg-gerrit/gerrit/change.rb', line 22 def initialize( = {}) raise ArgumentError unless @change_id = [:change_id] raise ArgumentError unless @subject = [:subject] raise ArgumentError unless @full_name = [:full_name] raise ArgumentError unless @last_updated_on = [:last_updated_on] end |
Instance Attribute Details
#change_id ⇒ Object (readonly)
Returns the value of attribute change_id.
20 21 22 |
# File 'lib/twigg-gerrit/gerrit/change.rb', line 20 def change_id @change_id end |
#full_name ⇒ Object (readonly)
Returns the value of attribute full_name.
20 21 22 |
# File 'lib/twigg-gerrit/gerrit/change.rb', line 20 def full_name @full_name end |
#last_updated_on ⇒ Object (readonly)
Returns the value of attribute last_updated_on.
20 21 22 |
# File 'lib/twigg-gerrit/gerrit/change.rb', line 20 def last_updated_on @last_updated_on end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
20 21 22 |
# File 'lib/twigg-gerrit/gerrit/change.rb', line 20 def subject @subject end |
Class Method Details
.changes ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/twigg-gerrit/gerrit/change.rb', line 5 def changes DB[:changes]. select(:change_id, :last_updated_on, :subject, :full_name). join(:accounts, account_id: :owner_account_id). where(status: 'n'). order(Sequel.desc(:last_updated_on)). all.map do |change| new(change_id: change[:change_id], subject: change[:subject], full_name: change[:full_name], last_updated_on: change[:last_updated_on]) end end |
Instance Method Details
#url ⇒ Object
29 30 31 |
# File 'lib/twigg-gerrit/gerrit/change.rb', line 29 def url Config.gerrit.web.host + '/' + change_id.to_s end |