Class: Ace::Support::Items::Models::ItemId

Inherits:
Struct
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#prefixObject

Returns the value of attribute prefix

Returns:

  • (Object)

    the current value of prefix



14
15
16
# File 'lib/ace/support/items/models/item_id.rb', line 14

def prefix
  @prefix
end

#raw_b36tsObject

Returns the value of attribute raw_b36ts

Returns:

  • (Object)

    the current value of raw_b36ts



14
15
16
# File 'lib/ace/support/items/models/item_id.rb', line 14

def raw_b36ts
  @raw_b36ts
end

#subtask_charObject

Returns the value of attribute subtask_char

Returns:

  • (Object)

    the current value of subtask_char



14
15
16
# File 'lib/ace/support/items/models/item_id.rb', line 14

def subtask_char
  @subtask_char
end

#suffixObject

Returns the value of attribute suffix

Returns:

  • (Object)

    the current value of suffix



14
15
16
# File 'lib/ace/support/items/models/item_id.rb', line 14

def suffix
  @suffix
end

#type_markerObject

Returns the value of attribute type_marker

Returns:

  • (Object)

    the current value of 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_idString

Full formatted ID with type marker (e.g., “8pp.t.q7w”)

Returns:

  • (String)


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_idString

Full formatted ID (alias for formatted_id)

Returns:

  • (String)


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

Returns:

  • (Boolean)


37
38
39
# File 'lib/ace/support/items/models/item_id.rb', line 37

def subtask?
  !subtask_char.nil?
end

#to_hObject



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