Class: STDDAPI::Objects::Module

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(run_id, name, kind, start_time) ⇒ Module

Returns a new instance of Module.



57
58
59
60
61
62
63
# File 'lib/objects.rb', line 57

def initialize(run_id,name,kind,start_time)
  @run_id = run_id
  @name = name
  @kind = kind
  @start_time = start_time

end

Instance Attribute Details

#idObject

Returns the value of attribute id.



64
65
66
# File 'lib/objects.rb', line 64

def id
  @id
end

#kindObject

Returns the value of attribute kind.



64
65
66
# File 'lib/objects.rb', line 64

def kind
  @kind
end

#nameObject

Returns the value of attribute name.



64
65
66
# File 'lib/objects.rb', line 64

def name
  @name
end

#run_idObject

Returns the value of attribute run_id.



64
65
66
# File 'lib/objects.rb', line 64

def run_id
  @run_id
end

#start_timeObject

Returns the value of attribute start_time.



64
65
66
# File 'lib/objects.rb', line 64

def start_time
  @start_time
end

#stop_timeObject

Returns the value of attribute stop_time.



64
65
66
# File 'lib/objects.rb', line 64

def stop_time
  @stop_time
end

Instance Method Details

#to_jsonObject



72
73
74
75
76
77
78
79
80
# File 'lib/objects.rb', line 72

def to_json
  {
    'name' => @name,
    'run_id' => @run_id,
    'kind' => @kind,
    'start_time'=> @start_time,
    'stop_time'=>@stop_time
  }.to_json
end

#to_sObject



65
66
67
68
69
70
71
# File 'lib/objects.rb', line 65

def to_s
  "name: #{@name}\n"+
  "id: #{@id}\n"+
  "run-id: #{@run_id}\n"+
  "kind: #{@kind}\n"+
  "start-time: #{@start_time}\n"
end