Class: BBCoder::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/bbcoder/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



5
6
7
# File 'lib/bbcoder/configuration.rb', line 5

def initialize
  @tags = {}
end

Instance Attribute Details

#tagsObject

Returns the value of attribute tags.



3
4
5
# File 'lib/bbcoder/configuration.rb', line 3

def tags
  @tags
end

Instance Method Details

#[](value) ⇒ Object



9
10
11
# File 'lib/bbcoder/configuration.rb', line 9

def [](value)
  @tags[value]
end

#clearObject



13
14
15
# File 'lib/bbcoder/configuration.rb', line 13

def clear
  @tags = {}
end

#remove(name) ⇒ Object



17
18
19
# File 'lib/bbcoder/configuration.rb', line 17

def remove name
  @tags.delete(name.to_sym)
end

#tag(name, options = {}, &block) ⇒ Object



21
22
23
# File 'lib/bbcoder/configuration.rb', line 21

def tag(name, options = {}, &block)
  @tags[name.to_sym] = BBCoder::Tag.new(name.to_sym, options.merge(:block => block))
end