Class: STDDAPI::Objects::Run

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_id, name, source = "", revision = "") ⇒ Run

Returns a new instance of Run.



31
32
33
34
35
36
37
# File 'lib/objects.rb', line 31

def initialize(project_id,name,source="",revision="")
  @project_id = project_id
  @name = name
  @source = source
  @revision = revision

end

Instance Attribute Details

#idObject

Returns the value of attribute id.



38
39
40
# File 'lib/objects.rb', line 38

def id
  @id
end

#nameObject

Returns the value of attribute name.



38
39
40
# File 'lib/objects.rb', line 38

def name
  @name
end

#project_idObject

Returns the value of attribute project_id.



38
39
40
# File 'lib/objects.rb', line 38

def project_id
  @project_id
end

#revisionObject

Returns the value of attribute revision.



38
39
40
# File 'lib/objects.rb', line 38

def revision
  @revision
end

#sourceObject

Returns the value of attribute source.



38
39
40
# File 'lib/objects.rb', line 38

def source
  @source
end

Instance Method Details

#to_jsonObject



46
47
48
49
50
51
52
53
# File 'lib/objects.rb', line 46

def to_json
  {
    'name' => @name,
    'project_id' => @project_id,
    'source'=> @source,
    'revision'=>@revision
  }.to_json
end

#to_sObject



39
40
41
42
43
44
45
# File 'lib/objects.rb', line 39

def to_s
  "name: #{@name}\n"+
  "id: #{@id}\n"+
  "project-id: #{@project_id}\n"+
  "source: #{@source}\n"+
  "revision: #{@revision}\n"
end