Class: Toy::Core::ModelEntry

Inherits:
Struct
  • Object
show all
Defined in:
lib/toy/core/model_scan.rb

Overview

One discovered model. Idiomatic struct (CRuby shell; no Spinel type-pin restrictions apply here).

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#familyObject

Returns the value of attribute family

Returns:

  • (Object)

    the current value of family



21
22
23
# File 'lib/toy/core/model_scan.rb', line 21

def family
  @family
end

#n_paramsObject

Returns the value of attribute n_params

Returns:

  • (Object)

    the current value of n_params



21
22
23
# File 'lib/toy/core/model_scan.rb', line 21

def n_params
  @n_params
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



21
22
23
# File 'lib/toy/core/model_scan.rb', line 21

def name
  @name
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



21
22
23
# File 'lib/toy/core/model_scan.rb', line 21

def path
  @path
end

#size_bObject

Returns the value of attribute size_b

Returns:

  • (Object)

    the current value of size_b



21
22
23
# File 'lib/toy/core/model_scan.rb', line 21

def size_b
  @size_b
end

#sourceObject

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



21
22
23
# File 'lib/toy/core/model_scan.rb', line 21

def source
  @source
end

Instance Method Details

#params_summaryObject



25
26
27
28
29
30
31
32
33
# File 'lib/toy/core/model_scan.rb', line 25

def params_summary
  if n_params >= 1_000_000_000
    format("%.1fB", n_params.to_f / 1_000_000_000.0)
  elsif n_params >= 1_000_000
    "#{n_params / 1_000_000}M"
  else
    n_params.to_s
  end
end

#size_summaryObject



35
36
37
38
39
40
41
# File 'lib/toy/core/model_scan.rb', line 35

def size_summary
  if size_b >= 1_000_000_000
    format("%.1f GB", size_b.to_f / 1_000_000_000.0)
  else
    "#{size_b / 1_000_000} MB"
  end
end