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.



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

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

Instance Method Details

#authorObject



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

def author
  @data['author']
end

#commentObject



255
256
257
# File 'lib/bamboo-client/rest.rb', line 255

def comment
  @data['comment']
end

#commit_urlObject



259
260
261
# File 'lib/bamboo-client/rest.rb', line 259

def commit_url
  @data['commitUrl']
end

#dateObject



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

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

#filesObject



263
264
265
266
267
268
269
270
271
# File 'lib/bamboo-client/rest.rb', line 263

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

#full_nameObject



247
248
249
# File 'lib/bamboo-client/rest.rb', line 247

def full_name
  @data['fullName']
end

#idObject



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

def id
  @data['changesetId']
end

#user_nameObject



251
252
253
# File 'lib/bamboo-client/rest.rb', line 251

def user_name
  @data['userName']
end