Module: Doing::StringTags
- Included in:
- String
- Defined in:
- lib/doing/string/tags.rb
Overview
Handling of @tags in strings
Instance Method Summary collapse
- 
  
    
      #add_at  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    Add @ prefix to string if needed, maintains +/- prefix. 
- 
  
    
      #add_tags(tags, remove: false)  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    Adds tags to a string. 
- #add_tags!(tags, remove: false) ⇒ Object
- 
  
    
      #dedup_tags  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Remove duplicate tags, leaving only first occurrence. 
- #dedup_tags! ⇒ Object
- 
  
    
      #remove_at  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    Removes @ prefix if needed, maintains +/- prefix. 
- 
  
    
      #split_tags  ⇒ Array 
    
    
  
  
  
  
  
  
  
  
  
    Split a string of tags, remove @ symbols, with or without @ symbols, with or without parenthetical values. 
- 
  
    
      #tag(tag, value: nil, remove: false, rename_to: nil, regex: false, single: false, force: false)  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    Add, rename, or remove a tag. 
- 
  
    
      #tag!(tag, **options)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Add, rename, or remove a tag in place. 
- 
  
    
      #to_tags  ⇒ Array 
    
    
  
  
  
  
  
  
  
  
  
    Convert a list of tags to an array. 
Instance Method Details
#add_at ⇒ String
Add @ prefix to string if needed, maintains +/- prefix
#add_tags(tags, remove: false) ⇒ String
Adds tags to a string
#add_tags!(tags, remove: false) ⇒ Object
#dedup_tags ⇒ Object
Remove duplicate tags, leaving only first occurrence
#dedup_tags! ⇒ Object
#remove_at ⇒ String
Removes @ prefix if needed, maintains +/- prefix
#split_tags ⇒ Array
Split a string of tags, remove @ symbols, with or without @ symbols, with or without parenthetical values
#tag(tag, value: nil, remove: false, rename_to: nil, regex: false, single: false, force: false) ⇒ String
Add, rename, or remove a tag
#tag!(tag, **options) ⇒ Object
Add, rename, or remove a tag in place
#to_tags ⇒ Array
Convert a list of tags to an array. Tags can be with or without @ symbols, separated by any character, and can include parenthetical values (with spaces)