Class: Casino::Document
- Inherits:
-
Object
- Object
- Casino::Document
- Defined in:
- lib/casino/document.rb
Instance Method Summary collapse
- #compose ⇒ Object
-
#initialize(key, question_names) ⇒ Document
constructor
A new instance of Document.
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
#compose ⇒ Object
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 |