Class: Casino::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/casino/document.rb

Instance Method Summary collapse

Constructor Details

#initialize(key, question_names) ⇒ Document

Returns a new instance of Document.



4
5
6
7
# File 'lib/casino/document.rb', line 4

def initialize(key, question_names)
  @key = key
  @question_names = Array question_names
end

Instance Method Details

#composeObject



9
10
11
12
13
14
15
# File 'lib/casino/document.rb', line 9

def compose
  klass = Class.new
  klass.send :include, Mongoid::Document
  klass.store_in collection: @key
  assign_fields klass
  klass
end