Class: Cuboid::RPC::Server::ActiveOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/cuboid/rpc/server/active_options.rb

Overview

It, for the most part, forwards calls to Options and intercepts a few that need to be updated at other places throughout the framework.

Author:

Instance Method Summary collapse

Constructor Details

#initializeActiveOptions

Returns a new instance of ActiveOptions.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/cuboid/rpc/server/active_options.rb', line 12

def initialize
    @options = Cuboid::Options.instance

    (@options.public_methods( false ) - public_methods( false ) ).each do |m|
        self.class.class_eval do
            define_method m do |*args|
                @options.send( m, *args )
            end
        end
    end
end

Instance Method Details

#set(options) ⇒ Object

See Also:



25
26
27
28
# File 'lib/cuboid/rpc/server/active_options.rb', line 25

def set( options )
    @options.set( options )
    true
end

#to_hObject



30
31
32
# File 'lib/cuboid/rpc/server/active_options.rb', line 30

def to_h
    @options.to_rpc_data
end