Class: ScriptCore::Stat

Inherits:
Struct show all
Defined in:
lib/script_core/stat.rb

Constant Summary collapse

Null =
Stat.new(
  instructions: 0,
  memory: 0,
  bytes_in: 0,
  time: 0,
  total_instructions: 0
)

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Struct

#_inspect, #dig, #each, #each_pair, #inspect, #select

Constructor Details

#initialize(options) ⇒ Stat

Returns a new instance of Stat.



5
6
7
# File 'lib/script_core/stat.rb', line 5

def initialize(options)
  super(options[:instructions], options[:memory], options[:bytes_in], options[:time], options[:total_instructions])
end

Instance Attribute Details

#bytes_inObject

Returns the value of attribute bytes_in

Returns:

  • (Object)

    the current value of bytes_in



4
5
6
# File 'lib/script_core/stat.rb', line 4

def bytes_in
  @bytes_in
end

#instructionsObject

Returns the value of attribute instructions

Returns:

  • (Object)

    the current value of instructions



4
5
6
# File 'lib/script_core/stat.rb', line 4

def instructions
  @instructions
end

#memoryObject

Returns the value of attribute memory

Returns:

  • (Object)

    the current value of memory



4
5
6
# File 'lib/script_core/stat.rb', line 4

def memory
  @memory
end

#timeObject

Returns the value of attribute time

Returns:

  • (Object)

    the current value of time



4
5
6
# File 'lib/script_core/stat.rb', line 4

def time
  @time
end

#total_instructionsObject

Returns the value of attribute total_instructions

Returns:

  • (Object)

    the current value of total_instructions



4
5
6
# File 'lib/script_core/stat.rb', line 4

def total_instructions
  @total_instructions
end