Class: BuildBuddy::BuildData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ BuildData

Returns a new instance of BuildData.



16
17
18
19
20
21
22
23
24
# File 'lib/build_buddy/build_data.rb', line 16

def initialize(args)
  args.each do |key, value|
    setter = self.method((key.to_s + '=').to_sym)

    unless setter.nil?
      setter.call(value)
    end
  end
end

Instance Attribute Details

#_idObject

Mongo ID



3
4
5
# File 'lib/build_buddy/build_data.rb', line 3

def _id
  @_id
end

#build_log_filenameObject

Returns the value of attribute build_log_filename.



14
15
16
# File 'lib/build_buddy/build_data.rb', line 14

def build_log_filename
  @build_log_filename
end

#build_typeObject

one of :master, :release or :pull_request



4
5
6
# File 'lib/build_buddy/build_data.rb', line 4

def build_type
  @build_type
end

#build_versionObject

Returns the value of attribute build_version.



6
7
8
# File 'lib/build_buddy/build_data.rb', line 6

def build_version
  @build_version
end

#end_timeObject

Returns the value of attribute end_time.



13
14
15
# File 'lib/build_buddy/build_data.rb', line 13

def end_time
  @end_time
end

#exit_codeObject

Returns the value of attribute exit_code.



11
12
13
# File 'lib/build_buddy/build_data.rb', line 11

def exit_code
  @exit_code
end

#pull_requestObject

Returns the value of attribute pull_request.



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

def pull_request
  @pull_request
end

#repo_full_nameObject

Returns the value of attribute repo_full_name.



5
6
7
# File 'lib/build_buddy/build_data.rb', line 5

def repo_full_name
  @repo_full_name
end

#repo_shaObject

Returns the value of attribute repo_sha.



9
10
11
# File 'lib/build_buddy/build_data.rb', line 9

def repo_sha
  @repo_sha
end

#start_timeObject

Returns the value of attribute start_time.



12
13
14
# File 'lib/build_buddy/build_data.rb', line 12

def start_time
  @start_time
end

#termination_typeObject

:killed or :exited



10
11
12
# File 'lib/build_buddy/build_data.rb', line 10

def termination_type
  @termination_type
end

Instance Method Details

#to_hObject



26
27
28
29
30
# File 'lib/build_buddy/build_data.rb', line 26

def to_h
  hash = {}
  instance_variables.each {|var| hash[var.to_s.delete("@")] = instance_variable_get(var) }
  hash
end