Class: Rules

Inherits:
Object
  • Object
show all
Defined in:
lib/bbcode/rules.rb

Instance Method Summary collapse

Constructor Details

#initialize(bbcode_element) ⇒ Rules

Returns a new instance of Rules.



2
3
4
# File 'lib/bbcode/rules.rb', line 2

def initialize bbcode_element
  @bbcode_element = bbcode_element
end

Instance Method Details

#bbcode_nameObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/bbcode/rules.rb', line 6

def bbcode_name
  case html_name
    when 'a'
      get_name_for_a
    when 'blockquote'
      'quote'
    when 'pre'
      'code'
    when 'strong'
      'b'
    when 'em'
      'i'
    when 'ins'
      'u'
    when 'del'
      's'
    when 'ul', 'ol'
      'list'
    when 'li'
      '*'
    when 'font'
      get_name_for_font
    when 'b', 'i', 'u', 's', 'img', 'table', 'td', 'tr'
      html_name
    when 'span'
      get_names_for_span
  end
end