Class: OpenHAB::Core::Types::StringListType

Inherits:
Object
  • Object
show all
Includes:
Command, State
Defined in:
lib/openhab/core/types/string_list_type.rb

Overview

StringListType can be used for items that are dealing with telephony functionality.

The entries can be accessed like an array.

Examples:

string_list = StringListType.new("a", "b", "c")
logger.info "first entry: #{string_list.first}" # => "a"
logger.info "second entry: #{string_list[1]}" # => "b"
logger.info "last entry: #{string_list.last}" # => "c"
logger.info "length: #{string_list.size}" # => 3

Instance Method Summary collapse

Methods included from Type

#eql?

Instance Method Details

#to_aArray<String>

Returns the values as an array.

Returns:

  • (Array<String>)

    the values as an array



36
37
38
# File 'lib/openhab/core/types/string_list_type.rb', line 36

def to_a
  typeDetails.to_a
end