Module: Wukong::Schema

Defined in:
lib/wukong/schema.rb

Overview

Export model’s structure for loading and manipulating in other frameworks, such as SQL and Pig

Your class should support the #resource_name and #mtypes methods An easy way to do this is by being a TypedStruct.

You can use this to do silly stunts like

% ruby -rubygems -r'wukong/schema' -e 'require "/path/to/user_model.rb" ; puts User.pig_load ; '

If you include the classes from Wukong::Datatypes::MoreTypes, you can draw on a richer set of type definitions

require 'wukong/datatypes/more_types'
include Wukong::Datatypes::MoreTypes
require 'wukong/schema'

(if you’re using Wukong to bulk-process Datamapper records, these should fall right in line as well – make sure not to include Wukong::Datatypes::MoreTypes, and to require ‘dm-more’ before ‘wukong/schema’)

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

standard stanza for making methods appear on the class itself on include



260
261
262
# File 'lib/wukong/schema.rb', line 260

def self.included base
  base.class_eval{ extend ClassMethods }
end