Class: Factorix::API::Tag
- Inherits:
-
Data
- Object
- Data
- Factorix::API::Tag
- Defined in:
- lib/factorix/api/tag.rb,
lib/factorix/api/tag.rb
Overview
Tag object from MOD Portal API
Represents a MOD tag with value, name, and description. Uses flyweight pattern - same tag value returns same instance.
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
Tag description.
-
#name ⇒ String
readonly
Human-readable tag name (e.g., “Transportation”, “Logistics”).
-
#value ⇒ String
readonly
Tag value (e.g., “transportation”, “logistics”).
Class Method Summary collapse
-
.for(value) ⇒ Tag
Get Tag instance for the given value.
-
.identifiers ⇒ Array<String>
All tag identifiers.
Instance Attribute Details
#description ⇒ String (readonly)
Returns tag description.
14 15 16 |
# File 'lib/factorix/api/tag.rb', line 14 def description @description end |
#name ⇒ String (readonly)
Returns human-readable tag name (e.g., “Transportation”, “Logistics”).
14 15 16 |
# File 'lib/factorix/api/tag.rb', line 14 def name @name end |
#value ⇒ String (readonly)
Returns tag value (e.g., “transportation”, “logistics”).
14 15 16 |
# File 'lib/factorix/api/tag.rb', line 14 def value @value end |
Class Method Details
.for(value) ⇒ Tag
Get Tag instance for the given value
Returns predefined instance for known tags (flyweight pattern). Raises an error for unknown tag values.
93 |
# File 'lib/factorix/api/tag.rb', line 93 def self.for(value) = TAGS.fetch(value.to_s) |
.identifiers ⇒ Array<String>
Returns all tag identifiers.
83 |
# File 'lib/factorix/api/tag.rb', line 83 def self.identifiers = TAGS.keys |