Class: Bamboo::Client::Rest::Change

Inherits:
Object
  • Object
show all
Defined in:
lib/bamboo-client/rest.rb

Overview

Result

Instance Method Summary collapse

Constructor Details

#initialize(data, http) ⇒ Change

Returns a new instance of Change.



219
220
221
222
# File 'lib/bamboo-client/rest.rb', line 219

def initialize(data, http)
  @data = data
  @http = http
end

Instance Method Details

#authorObject



232
233
234
# File 'lib/bamboo-client/rest.rb', line 232

def author
  @data['author']
end

#commentObject



244
245
246
# File 'lib/bamboo-client/rest.rb', line 244

def comment
  @data['comment']
end

#dateObject



228
229
230
# File 'lib/bamboo-client/rest.rb', line 228

def date
  Time.parse @data['date']
end

#filesObject



248
249
250
251
252
253
254
255
256
# File 'lib/bamboo-client/rest.rb', line 248

def files
  # could use expand here
  Array(@data.fetch('files')['file']).map do |data|
    {
      :name     => data['name'],
      :revision => data['revision']
    }
  end
end

#full_nameObject



236
237
238
# File 'lib/bamboo-client/rest.rb', line 236

def full_name
  @data['fullName']
end

#idObject



224
225
226
# File 'lib/bamboo-client/rest.rb', line 224

def id
  @data['changesetId']
end

#user_nameObject



240
241
242
# File 'lib/bamboo-client/rest.rb', line 240

def user_name
  @data['userName']
end