Sha256: eae12bb6bc4a8a411f7ae83ff14902727a3386c39c1a783aca16b7284b336142

Contents?: true

Size: 786 Bytes

Versions: 32

Compression:

Stored size: 786 Bytes

Contents

module Cuboid
module RPC
class Server

# It, for the most part, forwards calls to {Cuboid::Options} and intercepts
# a few that need to be updated at other places throughout the framework.
#
# @private
# @author Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
class ActiveOptions

    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

    # @see Cuboid::Options#set
    def set( options )
        @options.set( options )
        true
    end

    def to_h
        @options.to_rpc_data
    end

end

end
end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
cuboid-0.1.5 lib/cuboid/rpc/server/active_options.rb
cuboid-0.1.4 lib/cuboid/rpc/server/active_options.rb
cuboid-0.1.3 lib/cuboid/rpc/server/active_options.rb
cuboid-0.1.2 lib/cuboid/rpc/server/active_options.rb
cuboid-0.1.1 lib/cuboid/rpc/server/active_options.rb
cuboid-0.1.0 lib/cuboid/rpc/server/active_options.rb
cuboid-0.0.5 lib/cuboid/rpc/server/active_options.rb
cuboid-0.0.4 lib/cuboid/rpc/server/active_options.rb
cuboid-0.0.3 lib/cuboid/rpc/server/active_options.rb
cuboid-0.0.3alpha lib/cuboid/rpc/server/active_options.rb
cuboid-0.0.2alpha lib/cuboid/rpc/server/active_options.rb
cuboid-0.0.1alpha lib/cuboid/rpc/server/active_options.rb