Class: Arkaan::Rulesets::Fields::Gauge

Inherits:
Arkaan::Rulesets::Field show all
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.

Author:

Instance Attribute Summary

Attributes inherited from Arkaan::Rulesets::Field

#blueprint, #data, #name

Instance Method Summary collapse

Methods inherited from Arkaan::Rulesets::Field

#check_type, #name_unicity, #options_validity, #type

Instance Method Details

#default_optionsObject



7
8
9
# File 'lib/arkaan/rulesets/fields/gauge.rb', line 7

def default_options
  return {initial: 0, max: 100, min: 0, show: true}
end

#validate_optionsObject



11
12
13
14
15
16
# File 'lib/arkaan/rulesets/fields/gauge.rb', line 11

def validate_options
  check_type(:initial, 'Integer')
  check_type(:max, 'Integer')
  check_type(:min, 'Integer')
  check_type(:show, 'Boolean')
end