Class: Wisper::Configuration

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

Defined Under Namespace

Classes: Broadcasters

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.


7
8
9
# File 'lib/wisper/configuration.rb', line 7

def initialize
  @broadcasters = Broadcasters.new
end

Instance Attribute Details

#broadcastersObject (readonly)

Returns the value of attribute broadcasters


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

def broadcasters
  @broadcasters
end

Instance Method Details

#broadcaster(key, broadcaster) ⇒ Object

registers a broadcaster, referenced by key

Parameters:

  • key (String, #to_s)

    an arbitrary key

  • broadcaster (#broadcast)

    a broadcaster


15
16
17
18
# File 'lib/wisper/configuration.rb', line 15

def broadcaster(key, broadcaster)
  @broadcasters[key] = broadcaster
  self
end

#default_prefix=(value) ⇒ String

sets the default value for prefixes

Parameters:

  • value (#to_s)

Returns:

  • (String)

25
26
27
# File 'lib/wisper/configuration.rb', line 25

def default_prefix=(value)
  ValueObjects::Prefix.default = value
end