Module: Taggart

Defined in:
lib/taggart.rb

Overview

Taggart surrounds your strings with HTML tags.

 Author: Jocke Selin <[email protected]>
         @jockeselin
   Date: 2012-10-10
Version: 0.0.8 Build 013
 Github: https://github.com/jocke/taggart

Defined Under Namespace

Modules: Array, String

Constant Summary collapse

VERSION =
'0.0.8'
BUILD =
'013'
CLOSED_TAG =
' /'
OPEN_TAG =
''

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.buildObject



27
28
29
# File 'lib/taggart.rb', line 27

def self.build
  BUILD
end

.close_ending_tagObject



65
66
67
68
# File 'lib/taggart.rb', line 65

def self.close_ending_tag
  @current_close_tag = CLOSED_TAG
  true
end

.end_tag_closed?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/taggart.rb', line 57

def self.end_tag_closed?
  (end_tag_status? == :closed)
end

.end_tag_open?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/taggart.rb', line 61

def self.end_tag_open?
  (end_tag_status? == :open)
end

.end_tag_status?Boolean

Returns true if the tags are open, false if they’re closed

Returns:

  • (Boolean)


53
54
55
# File 'lib/taggart.rb', line 53

def self.end_tag_status?
  (@current_close_tag == OPEN_TAG) ? :open : :closed
end

.helpObject



31
32
33
# File 'lib/taggart.rb', line 31

def self.help
  TaggartHelp.help
end

.open_ending_tagObject



70
71
72
73
# File 'lib/taggart.rb', line 70

def self.open_ending_tag
  @current_close_tag = OPEN_TAG
  true
end

.single_tagsObject



47
48
49
# File 'lib/taggart.rb', line 47

def self.single_tags
  Taggart::String::SINGLE_TAGS 
end

.special_tagsObject



43
44
45
# File 'lib/taggart.rb', line 43

def self.special_tags
  Taggart::String::SPECIAL_TAGS
end

.standard_tagsObject



39
40
41
# File 'lib/taggart.rb', line 39

def self.standard_tags
  Taggart::String::STANDARD_TAGS
end

.tagsObject



35
36
37
# File 'lib/taggart.rb', line 35

def self.tags
  TaggartHelp.tags
end

.versionObject



23
24
25
# File 'lib/taggart.rb', line 23

def self.version
  VERSION
end

Instance Method Details

#initializeObject



19
20
21
# File 'lib/taggart.rb', line 19

def initialize
  @current_close_tag = OPEN_TAG
end