Class: Build

Inherits:
Object
  • Object
show all
Defined in:
lib/build.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(build = nil) ⇒ Build

Returns a new instance of Build.



2
3
4
5
# File 'lib/build.rb', line 2

def initialize(build=nil)
  @build = build
  @check_build = false 
end

Instance Attribute Details

#buildObject

Returns the value of attribute build.



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

def build
  @build
end

#check_buildObject

Returns the value of attribute check_build.



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

def check_build
  @check_build
end

Instance Method Details

#checkObject



10
11
12
13
14
15
16
17
# File 'lib/build.rb', line 10

def check
  puts "checking if build already exists"
  begin
    @build = $server.call("Build.check_build", @build["name"], @build["product"])
  rescue
    return @build
  end 
end

#createObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/build.rb', line 19

def create
  if @build["name"].nil?
    puts "Build name not set"
    return false
  elsif @build["product"].nil?
    puts "Build product not set"
    return false
  end
  puts @check_build
  if @check_build == true
    self.check
  end
  @build = $server.call("Build.create", @build)
  return @build
end