Module: OpenHAB::Core::Items::Semantics::TagClassMethods
- Defined in:
- lib/openhab/core/items/semantics/tag_class_methods.rb
Overview
Adds tag attributes to the semantic tag class
Instance Method Summary collapse
-
#description(locale = nil) ⇒ String
Returns the tag’s description.
-
#label(locale = nil) ⇒ String
Returns the tag’s label.
-
#synonyms(locale = nil) ⇒ Array<String>
Returns the tag’s synonyms.
Instance Method Details
#description(locale = nil) ⇒ String
Returns the tag’s description
53 54 55 56 57 58 59 |
# File 'lib/openhab/core/items/semantics/tag_class_methods.rb', line 53 def description(locale = nil) unless SemanticTags.respond_to?(:get_description) return java_class.get_annotation(org.openhab.core.semantics.TagInfo.java_class).description end SemanticTags.get_description(java_class, locale || java.util.Locale.default) end |
#label(locale = nil) ⇒ String
Returns the tag’s label
24 25 26 |
# File 'lib/openhab/core/items/semantics/tag_class_methods.rb', line 24 def label(locale = nil) SemanticTags.get_label(java_class, locale || java.util.Locale.default) end |
#synonyms(locale = nil) ⇒ Array<String>
Returns the tag’s synonyms
36 37 38 39 40 41 42 43 |
# File 'lib/openhab/core/items/semantics/tag_class_methods.rb', line 36 def synonyms(locale = nil) unless SemanticTags.respond_to?(:get_synonyms) return java_class.get_annotation(org.openhab.core.semantics.TagInfo.java_class).synonyms .split(",").map(&:strip) end SemanticTags.get_synonyms(java_class, locale || java.util.Locale.default).to_a end |