Module: BBCoder::Tag::ClassMethods
- Included in:
- BBCoder::Tag
- Defined in:
- lib/bbcoder/tag.rb
Instance Method Summary collapse
- #reform(tag, meta, content = nil) ⇒ Object
- #reform_end(tag) ⇒ Object
- #reform_open(tag, meta) ⇒ Object
- #to_html(tag, meta, content) ⇒ Object
Instance Method Details
#reform(tag, meta, content = nil) ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/bbcoder/tag.rb', line 40 def reform(tag, , content = nil) if content.nil? %(#{reform_open(tag, )}) else %(#{reform_open(tag, )}#{content}#{reform_end(tag)}) end end |
#reform_end(tag) ⇒ Object
56 57 58 |
# File 'lib/bbcoder/tag.rb', line 56 def reform_end(tag) "[/#{tag}]" end |
#reform_open(tag, meta) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/bbcoder/tag.rb', line 48 def reform_open(tag, ) if .nil? || .empty? "[#{tag}]" else "[#{tag}=#{}]" end end |
#to_html(tag, meta, content) ⇒ Object
36 37 38 |
# File 'lib/bbcoder/tag.rb', line 36 def to_html(tag, , content) BBCoder.configuration[tag].to_html(, content) end |