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.



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

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

Instance Method Details

#authorObject



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

def author
  @data['author']
end

#commentObject



249
250
251
# File 'lib/bamboo-client/rest.rb', line 249

def comment
  @data['comment']
end

#dateObject



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

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

#filesObject



253
254
255
256
257
258
259
260
261
# File 'lib/bamboo-client/rest.rb', line 253

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

#full_nameObject



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

def full_name
  @data['fullName']
end

#idObject



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

def id
  @data['changesetId']
end

#user_nameObject



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

def user_name
  @data['userName']
end