class Nucleo::Models::Tag

Public Class Methods

new(attributes={}) click to toggle source
# File lib/nucleo/models/tag.rb, line 6
def initialize(attributes={})
  @attributes = attributes
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/nucleo/models/tag.rb, line 10
def <=>(other)
  self.length <=> other.length
end
content()
Alias for: tag_content
content_length() click to toggle source

Returns the content length

@return [Integer]

# File lib/nucleo/models/tag.rb, line 33
def content_length
  @attributes['content_length'].to_i
end
Also aliased as: length
full_tag() click to toggle source

Returns the full tag content

@return [String]

# File lib/nucleo/models/tag.rb, line 17
def full_tag
  @attributes['full_tag']
end
Also aliased as: raw_content
length()
Alias for: content_length
raw_content()
Alias for: full_tag
snippet() click to toggle source

Returns the HTML wrapped snippet

@todo: Extract this to a view helper

@return [String]

# File lib/nucleo/models/tag.rb, line 43
def snippet
  "<p><code>%s</code></p>" % [CGI.escapeHTML(self.full_tag)]
end
tag_content() click to toggle source

Returns the tag content

@return [String]

# File lib/nucleo/models/tag.rb, line 25
def tag_content
  @attributes['tag_content']
end
Also aliased as: content