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.2.11 lib/cuboid/rpc/server/active_options.rb
cuboid-0.2.10 lib/cuboid/rpc/server/active_options.rb
cuboid-0.2.9 lib/cuboid/rpc/server/active_options.rb
cuboid-0.2.8 lib/cuboid/rpc/server/active_options.rb
cuboid-0.2.7 lib/cuboid/rpc/server/active_options.rb
cuboid-0.2.6 lib/cuboid/rpc/server/active_options.rb
cuboid-0.2.5 lib/cuboid/rpc/server/active_options.rb
cuboid-0.2.4.2 lib/cuboid/rpc/server/active_options.rb
cuboid-0.2.4.1 lib/cuboid/rpc/server/active_options.rb
cuboid-0.2.4 lib/cuboid/rpc/server/active_options.rb
cuboid-0.2.3 lib/cuboid/rpc/server/active_options.rb
cuboid-0.2.2 lib/cuboid/rpc/server/active_options.rb
cuboid-0.2.1 lib/cuboid/rpc/server/active_options.rb
cuboid-0.2 lib/cuboid/rpc/server/active_options.rb
cuboid-0.1.9.1 lib/cuboid/rpc/server/active_options.rb
cuboid-0.1.9 lib/cuboid/rpc/server/active_options.rb
cuboid-0.1.8 lib/cuboid/rpc/server/active_options.rb
cuboid-0.1.7 lib/cuboid/rpc/server/active_options.rb
cuboid-0.1.6.1 lib/cuboid/rpc/server/active_options.rb
cuboid-0.1.6 lib/cuboid/rpc/server/active_options.rb