Class: Arkaan::Rulesets::Fields::Gauge
- Inherits:
-
Arkaan::Rulesets::Field
- Object
- Arkaan::Rulesets::Field
- Arkaan::Rulesets::Fields::Gauge
- Defined in:
- lib/arkaan/rulesets/fields/gauge.rb
Overview
A gauge is composed of a max value, and a min value, and when instanciated has a current value that can’t go above max or below min.
Instance Attribute Summary
Attributes inherited from Arkaan::Rulesets::Field
Instance Method Summary collapse
Methods inherited from Arkaan::Rulesets::Field
#check_type, #name_unicity, #options_validity, #type
Instance Method Details
#default_options ⇒ Object
7 8 9 |
# File 'lib/arkaan/rulesets/fields/gauge.rb', line 7 def return {initial: 0, max: 100, min: 0, show: true} end |
#validate_options ⇒ Object
11 12 13 14 15 16 |
# File 'lib/arkaan/rulesets/fields/gauge.rb', line 11 def check_type(:initial, 'Integer') check_type(:max, 'Integer') check_type(:min, 'Integer') check_type(:show, 'Boolean') end |