Class: Tc4r::Build

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Serializers::JSON
Defined in:
lib/tc4r/build.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options, client) ⇒ Build

Returns a new instance of Build.



7
8
9
10
11
12
13
14
15
16
# File 'lib/tc4r/build.rb', line 7

def initialize(options,client)
  options = Tc4r::Helpers.symbolize(options)
  @id = options[:id]
  @number = options[:number]
  @status = options[:status]
  @build_type_id = options[:build_type_id]
  @start_date = Time.parse(options[:start_date])
  @href = options[:href]
  @client = client
end

Instance Attribute Details

#build_type_idObject (readonly)

Returns the value of attribute build_type_id.



6
7
8
# File 'lib/tc4r/build.rb', line 6

def build_type_id
  @build_type_id
end

#clientObject (readonly)

Returns the value of attribute client.



6
7
8
# File 'lib/tc4r/build.rb', line 6

def client
  @client
end

#hrefObject (readonly)

Returns the value of attribute href.



6
7
8
# File 'lib/tc4r/build.rb', line 6

def href
  @href
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/tc4r/build.rb', line 6

def id
  @id
end

#numberObject (readonly)

Returns the value of attribute number.



6
7
8
# File 'lib/tc4r/build.rb', line 6

def number
  @number
end

#start_dateObject (readonly)

Returns the value of attribute start_date.



6
7
8
# File 'lib/tc4r/build.rb', line 6

def start_date
  @start_date
end

#statusObject (readonly)

Returns the value of attribute status.



6
7
8
# File 'lib/tc4r/build.rb', line 6

def status
  @status
end

Instance Method Details

#attributesObject



18
19
20
# File 'lib/tc4r/build.rb', line 18

def attributes
  { :id => @id, :number => @number, :status => @status, :build_type_id => @build_type_id, :start_date => @start_date, :href => @href }
end

#download_file(file, options = {}) ⇒ Object



22
23
24
# File 'lib/tc4r/build.rb', line 22

def download_file(file, options = {})
  client.download_file(build_type_id,number,file,options)
end