Module: Rufus::Tokyo

Defined in:
lib/rufus/tokyo/base.rb,
lib/rufus/tokyo/hmethods.rb,
lib/rufus/tokyo/cabinet/lib.rb,
lib/rufus/tokyo/cabinet/util.rb,
lib/rufus/tokyo/dystopia/lib.rb,
lib/rufus/tokyo/cabinet/table.rb,
lib/rufus/tokyo/dystopia/words.rb,
lib/rufus/tokyo/cabinet/abstract.rb

Defined Under Namespace

Modules: CabinetLib, DystopiaLib, HashMethods, TokyoContainerMixin Classes: Cabinet, DystopianError, List, Map, Table, TableQuery, TableResultSet, TokyoError, Words

Constant Summary collapse

VERSION =
'0.1.4'

Class Method Summary collapse

Class Method Details

.generate_lib_mixin(lib_module) ⇒ Object

Generates a lib mixin from a FFI module.

Including this mixin will simply bind two #lib methods (call and instance) returning the FFI module.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/rufus/tokyo/base.rb', line 105

def self.generate_lib_mixin (lib_module)
  eval %{
    module #{lib_module}Mixin
      def self.included (target)
        target.class_eval do
          def self.lib
            #{lib_module}
          end
          def lib
            self.class.lib
          end
        end
      end
    end
  }
end