Class: BigbluebuttonRails::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/bigbluebutton_rails/configuration.rb', line 21

def initialize
  @controllers = {
    servers: 'bigbluebutton/servers',
    rooms: 'bigbluebutton/rooms',
    recordings: 'bigbluebutton/recordings',
    playback_types: 'bigbluebutton/playback_types'
  }
  @routing_scope = 'bigbluebutton'

  @metadata_room_id        = :'bbbrails-room-id'
  @metadata_user_id        = :'bbbrails-user-id'
  @metadata_user_name      = :'bbbrails-user-name'
  @metadata_invitation_url = :'invitation-url'
  @metadata_invalid_keys =
    [ @metadata_room_id, @metadata_user_id,
      @metadata_user_name, @metadata_invitation_url ]

  @user_attr_name = :'name'
  @user_attr_id   = :'id'
  @use_local_voice_bridges = false
  @guest_support = false

  # How to find the room of a recording using the `data` returned by
  # a `getRecordings`.
  @match_room_recording = Proc.new do |data, *args|
    BigbluebuttonRoom.find_by_meetingid(data[:meetingid])
  end

  # Default method to return the invitation URL of a room. By default
  # returns nil (disable the feature).
  @get_invitation_url = Proc.new{ |room| nil }

  # Default method to get the dynamic metadata to use when creating a
  # conference in a room.
  @get_dynamic_metadata = Proc.new{ |room| nil }

  # Selects a server to be used by `room` whenever it needs to make API calls.
  # By default, if no servers are available an exception is raised.
  #
  # This method can be overwritten to change the way the server is selected
  # before a room is used. `api_method` contains the API method that is being
  # called. Any server returned here will be used. It *must* return a server,
  # otherwise the API calls will fail and the code will probably break.
  #
  # One good example is to always select a new server when a meeting is being
  # created (in case `api_method` is `:create`), making this a simple load
  # balancing tool that can work well in simple cases.
  @select_server = Proc.new do |room, api_method=nil|
    room.select_server(api_method)
  end
end

Instance Attribute Details

#controllersObject

Returns the value of attribute controllers.



4
5
6
# File 'lib/bigbluebutton_rails/configuration.rb', line 4

def controllers
  @controllers
end

#get_dynamic_metadataObject

Returns the value of attribute get_dynamic_metadata.



19
20
21
# File 'lib/bigbluebutton_rails/configuration.rb', line 19

def 
  @get_dynamic_metadata
end

#get_invitation_urlObject

Returns the value of attribute get_invitation_url.



18
19
20
# File 'lib/bigbluebutton_rails/configuration.rb', line 18

def get_invitation_url
  @get_invitation_url
end

#guest_supportObject

Returns the value of attribute guest_support.



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

def guest_support
  @guest_support
end

#match_room_recordingObject

Returns the value of attribute match_room_recording.



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

def match_room_recording
  @match_room_recording
end

#metadata_invalid_keysObject

Returns the value of attribute metadata_invalid_keys.



10
11
12
# File 'lib/bigbluebutton_rails/configuration.rb', line 10

def 
  @metadata_invalid_keys
end

#metadata_invitation_urlObject

Returns the value of attribute metadata_invitation_url.



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

def 
  @metadata_invitation_url
end

#metadata_room_idObject

Returns the value of attribute metadata_room_id.



6
7
8
# File 'lib/bigbluebutton_rails/configuration.rb', line 6

def 
  @metadata_room_id
end

#metadata_user_idObject

Returns the value of attribute metadata_user_id.



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

def 
  @metadata_user_id
end

#metadata_user_nameObject

Returns the value of attribute metadata_user_name.



8
9
10
# File 'lib/bigbluebutton_rails/configuration.rb', line 8

def 
  @metadata_user_name
end

#routing_scopeObject

Returns the value of attribute routing_scope.



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

def routing_scope
  @routing_scope
end

#select_serverObject

methods



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

def select_server
  @select_server
end

#use_local_voice_bridgesObject

Returns the value of attribute use_local_voice_bridges.



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

def use_local_voice_bridges
  @use_local_voice_bridges
end

#user_attr_idObject

Returns the value of attribute user_attr_id.



12
13
14
# File 'lib/bigbluebutton_rails/configuration.rb', line 12

def user_attr_id
  @user_attr_id
end

#user_attr_nameObject

Returns the value of attribute user_attr_name.



11
12
13
# File 'lib/bigbluebutton_rails/configuration.rb', line 11

def user_attr_name
  @user_attr_name
end

Instance Method Details

#set_controllers(options) ⇒ Object



73
74
75
76
77
# File 'lib/bigbluebutton_rails/configuration.rb', line 73

def set_controllers(options)
  unless options.nil? || options.empty?
    @controllers.merge!(options).slice!(:servers, :rooms, :recordings, :playback_types)
  end
end