Module: IMS::LTI::Models::Serializable

Instance Method Summary collapse

Instance Method Details

#as_json(opts = {}) ⇒ Object



3
4
5
6
# File 'lib/ims/lti/models/serializable.rb', line 3

def as_json(opts={})
  class_name = self.class.name.gsub(/^IMS::LTI::Models/, 'IMS::LTI::Serializers') + 'Serializer'
  Object.const_get(class_name).as_json(self)
end

#to_jsonObject



8
9
10
# File 'lib/ims/lti/models/serializable.rb', line 8

def to_json
  as_json.to_json
end