Module: Ocm::Ormable

Defined in:
lib/ocm/ormable.rb

Overview

todo: Name this something better, lame name

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(by) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/ocm/ormable.rb', line 9

def self.included(by)
  puts "included by #{by}"
  by.class_eval do
    include Idable
    include Jsonable
  end
  by.extend(ClassMethods)
end

Instance Method Details

#initialize(options = {}) ⇒ Object



22
23
24
25
26
27
28
29
30
31
# File 'lib/ocm/ormable.rb', line 22

def initialize(options={})
  options.each_pair do |key,value|
    var_name = "@#{key}"
#    self.class.__send__(:attr_accessor, var_name)
#    self.__send__("")
    instance_variable_set var_name, value
#    send(:define_method, var_name)
  end
#  @struct = OpenStruct.new(options)
end