Sha256: 5363384a9fbd5ec51e58ea65799e2cf99ad8c59b966a40accc158eef1aa234ba

Contents?: true

Size: 553 Bytes

Versions: 9

Compression:

Stored size: 553 Bytes

Contents

include_set Abstract::Pointer

abstract_basket :item_codenames

# simplify api
# Self::MyCodePointerSet.add_item :my_item_codename
# instead of
# Self::MyCodePointerSet.add_to_basket :item_codenames, :my_item_codename
module ClassMethods
  def add_item codename
    if Card::Codename.exist? codename
      add_to_basket :item_codenames, codename
    else
      warn "unknown codename '#{codename}' added to code pointer"
    end
  end
end

def content
  item_codenames.map do |codename|
    Card.fetch_name codename
  end.compact.to_pointer_content
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
card-1.96.4 mod/pointer/set/abstract/code_pointer.rb
card-1.96.3 mod/pointer/set/abstract/code_pointer.rb
card-1.96.2 mod/pointer/set/abstract/code_pointer.rb
card-1.96.1 mod/pointer/set/abstract/code_pointer.rb
card-1.96.0 mod/pointer/set/abstract/code_pointer.rb
card-1.95.3 mod/pointer/set/abstract/code_pointer.rb
card-1.95.2 mod/pointer/set/abstract/code_pointer.rb
card-1.95.1 mod/pointer/set/abstract/code_pointer.rb
card-1.95.0 mod/pointer/set/abstract/code_pointer.rb