Class: Growatt::Enum
- Inherits:
-
Object
- Object
- Growatt::Enum
- Defined in:
- lib/growatt/const.rb
Overview
A base class for defining enumerations using constants.
This class dynamically defines constants from an array of strings.
Class Method Summary collapse
-
.enum(array) ⇒ Object
Defines constants based on the provided array.
Class Method Details
.enum(array) ⇒ Object
Defines constants based on the provided array.
11 12 13 14 15 |
# File 'lib/growatt/const.rb', line 11 def self.enum(array) array.each do |c| const_set c, c end end |