Class: Toy::Core::ModelEntry
- Inherits:
-
Struct
- Object
- Struct
- Toy::Core::ModelEntry
- 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
-
#family ⇒ Object
Returns the value of attribute family.
-
#n_params ⇒ Object
Returns the value of attribute n_params.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#size_b ⇒ Object
Returns the value of attribute size_b.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
Instance Attribute Details
#family ⇒ Object
Returns the value of attribute family
21 22 23 |
# File 'lib/toy/core/model_scan.rb', line 21 def family @family end |
#n_params ⇒ Object
Returns the value of attribute n_params
21 22 23 |
# File 'lib/toy/core/model_scan.rb', line 21 def n_params @n_params end |
#name ⇒ Object
Returns the value of attribute name
21 22 23 |
# File 'lib/toy/core/model_scan.rb', line 21 def name @name end |
#path ⇒ Object
Returns the value of attribute path
21 22 23 |
# File 'lib/toy/core/model_scan.rb', line 21 def path @path end |
#size_b ⇒ Object
Returns the value of attribute size_b
21 22 23 |
# File 'lib/toy/core/model_scan.rb', line 21 def size_b @size_b end |
#source ⇒ Object
Returns the value of attribute source
21 22 23 |
# File 'lib/toy/core/model_scan.rb', line 21 def source @source end |
Instance Method Details
#params_summary ⇒ Object
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_summary ⇒ Object
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 |