Class: Crystalball::ExecutionMap::Metadata

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

Overview

Simple data object for map metadata information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(commit: nil, type: nil, version: nil, timestamp: nil) ⇒ Metadata

Returns a new instance of Metadata.

Parameters:

  • commit (String) (defaults to: nil)
    • SHA of commit

  • type (String) (defaults to: nil)
    • type of execution map

  • version (Numeric) (defaults to: nil)
    • map generator version number



15
16
17
18
19
20
# File 'lib/crystalball/execution_map.rb', line 15

def initialize(commit: nil, type: nil, version: nil, timestamp: nil)
  @commit = commit
  @type = type
  @timestamp = timestamp
  @version = version
end

Instance Attribute Details

#commitObject (readonly)

Returns the value of attribute commit.



10
11
12
# File 'lib/crystalball/execution_map.rb', line 10

def commit
  @commit
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



10
11
12
# File 'lib/crystalball/execution_map.rb', line 10

def timestamp
  @timestamp
end

#typeObject (readonly)

Returns the value of attribute type.



10
11
12
# File 'lib/crystalball/execution_map.rb', line 10

def type
  @type
end

#versionObject (readonly)

Returns the value of attribute version.



10
11
12
# File 'lib/crystalball/execution_map.rb', line 10

def version
  @version
end

Instance Method Details

#to_hObject



22
23
24
# File 'lib/crystalball/execution_map.rb', line 22

def to_h
  {type: type, commit: commit, timestamp: timestamp, version: version}
end