Class: Amrita::TagInfo::TagInfoItem

Class Amrita::TagInfo::TagInfoItem |
In: | lib/amrita/tag.rb
Parent: | Object

Methods

freeze new set_url_attr url_attr?

Attributes

:can_be_empty | [RW] | If true, it will be printed <hr> not <hr></hr>
:pptype | [RW] | pptype specfies pretty print type. This value should be one of these.
           FORMAT 1
              |.....
              |<tag>
              |.....
              |</tag>
              |......
           FORMAT 2
              |.....
              |<tag>......</tag>
              |.....
           FORMAT 3
              |.....<tag>......</tag>.....
              |

     Default is 3
:tag_class | [RW] | pptype specfies pretty print type. This value should be one of these.
           FORMAT 1
              |.....
              |<tag>
              |.....
              |</tag>
              |......
           FORMAT 2
              |.....
              |<tag>......</tag>
              |.....
           FORMAT 3
              |.....<tag>......</tag>.....
              |

     Default is 3
:tagname | [R] |

Public Class methods

new(tagname, pptype=3)

    # File lib/amrita/tag.rb, line 70
          def initialize(tagname, pptype=3)
            @pptype = pptype
            @url_attributes = nil
            @can_be_empty = false
            @tag_class = nil
          end

Public Instance methods

freeze()

    # File lib/amrita/tag.rb, line 77
          def freeze
            @pptype.freeze

            @url_attributes.freeze
            @can_be_empty.freeze
            super
            self
          end

set_url_attr(*names)

    # File lib/amrita/tag.rb, line 86
          def set_url_attr(*names)
            @url_attributes ||= {}
            names.each do |n|
              @url_attributes[n] = true
            end
          end

url_attr?(attr_name)

check if this attribute can have url as value.

    # File lib/amrita/tag.rb, line 94
          def url_attr?(attr_name)
            return false unless @url_attributes
            case attr_name
            when nil
              return false
            when Symbol
            when String
              attr_name = attr_name.intern
            else
              attr_name = attr_name.to_s.intern
            end
            @url_attributes[attr_name]
          end