Class: Ace::Support::Items::Models::ItemId
- Inherits:
-
Struct
- Object
- Struct
- Ace::Support::Items::Models::ItemId
- Defined in:
- lib/ace/support/items/models/item_id.rb
Overview
Value object representing a parsed item ID with type marker.
A 6-char b36ts ID (e.g., “8ppq7w”) can be split into a type-marked format:
prefix (3 chars) + type_marker (e.g., ".t.") + suffix (3 chars)
=> "8pp.t.q7w"
Subtasks append a single char: “8pp.t.q7w.a”
Instance Attribute Summary collapse
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#raw_b36ts ⇒ Object
Returns the value of attribute raw_b36ts.
-
#subtask_char ⇒ Object
Returns the value of attribute subtask_char.
-
#suffix ⇒ Object
Returns the value of attribute suffix.
-
#type_marker ⇒ Object
Returns the value of attribute type_marker.
Instance Method Summary collapse
-
#formatted_id ⇒ String
Full formatted ID with type marker (e.g., “8pp.t.q7w”).
-
#full_id ⇒ String
Full formatted ID (alias for formatted_id).
-
#subtask? ⇒ Boolean
Whether this represents a subtask.
- #to_h ⇒ Object
Instance Attribute Details
#prefix ⇒ Object
Returns the value of attribute prefix
14 15 16 |
# File 'lib/ace/support/items/models/item_id.rb', line 14 def prefix @prefix end |
#raw_b36ts ⇒ Object
Returns the value of attribute raw_b36ts
14 15 16 |
# File 'lib/ace/support/items/models/item_id.rb', line 14 def raw_b36ts @raw_b36ts end |
#subtask_char ⇒ Object
Returns the value of attribute subtask_char
14 15 16 |
# File 'lib/ace/support/items/models/item_id.rb', line 14 def subtask_char @subtask_char end |
#suffix ⇒ Object
Returns the value of attribute suffix
14 15 16 |
# File 'lib/ace/support/items/models/item_id.rb', line 14 def suffix @suffix end |
#type_marker ⇒ Object
Returns the value of attribute type_marker
14 15 16 |
# File 'lib/ace/support/items/models/item_id.rb', line 14 def type_marker @type_marker end |
Instance Method Details
#formatted_id ⇒ String
Full formatted ID with type marker (e.g., “8pp.t.q7w”)
24 25 26 27 |
# File 'lib/ace/support/items/models/item_id.rb', line 24 def formatted_id base = "#{prefix}.#{type_marker}.#{suffix}" subtask_char ? "#{base}.#{subtask_char}" : base end |
#full_id ⇒ String
Full formatted ID (alias for formatted_id)
31 32 33 |
# File 'lib/ace/support/items/models/item_id.rb', line 31 def full_id formatted_id end |
#subtask? ⇒ Boolean
Whether this represents a subtask
37 38 39 |
# File 'lib/ace/support/items/models/item_id.rb', line 37 def subtask? !subtask_char.nil? end |
#to_h ⇒ Object
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/ace/support/items/models/item_id.rb', line 41 def to_h { raw_b36ts: raw_b36ts, prefix: prefix, type_marker: type_marker, suffix: suffix, subtask_char: subtask_char, formatted_id: formatted_id } end |