Class: OpenHAB::Core::Types::StateDescription
- Inherits:
-
Object
- Object
- OpenHAB::Core::Types::StateDescription
- Defined in:
- lib/openhab/core/types/state_description.rb
Overview
Describes restrictions of an item state and gives information how to interpret it
Instance Attribute Summary collapse
- #options ⇒ Array<org.openhab.core.types.StateOption> readonly
- #pattern ⇒ String? readonly
- #range ⇒ Range? readonly
- #read_only? ⇒ true, false readonly
- #step ⇒ BigDecimal? readonly
Instance Method Summary collapse
Instance Attribute Details
#options ⇒ Array<org.openhab.core.types.StateOption> (readonly)
|
# File 'lib/openhab/core/types/state_description.rb', line 19
|
#pattern ⇒ String? (readonly)
|
# File 'lib/openhab/core/types/state_description.rb', line 13
|
#range ⇒ Range? (readonly)
24 25 26 27 28 |
# File 'lib/openhab/core/types/state_description.rb', line 24 def range return nil unless minimum || maximum minimum..maximum end |
#read_only? ⇒ true, false (readonly)
|
# File 'lib/openhab/core/types/state_description.rb', line 16
|
#step ⇒ BigDecimal? (readonly)
|
# File 'lib/openhab/core/types/state_description.rb', line 10
|
Instance Method Details
#inspect ⇒ String
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/openhab/core/types/state_description.rb', line 31 def inspect s = "#<OpenHAB::Core::Types::StateDescription" r = range s += " read_only" if read_only? s += " range=#{r}" if r s += " step=#{step}" if step s += " pattern=#{pattern.inspect}" if pattern && !pattern.empty? unless options.empty? s += " options=[" options.each_with_index do |o, i| s += ", " if i != 0 s += o.value.inspect s += " (#{o.label.inspect})" if o.value != o.label && !o.label.nil? end s += "]" end "#{s}>" end |