module Alexa::Container

Attributes

data[RW]

Public Class Methods

included(base) click to toggle source
# File lib/alexa/container.rb, line 49
def self.included(base)
  base.extend(ClassMethods)
end

Public Instance Methods

keys() click to toggle source
# File lib/alexa/container.rb, line 6
def keys
  @data.keys
end
method_missing(name) click to toggle source
# File lib/alexa/container.rb, line 14
def method_missing(name)
  myname = ActiveSupport::Inflector.underscore(name).to_sym
  raise Exception.new("there is no data field called \"#{name}\" here!") unless @data.has_key?(myname) || @data.has_key?(myname.to_s)

  if @data.has_key?(myname)
    return @data[myname]
  end

  if @data.has_key?(myname.to_s)
    return @data[myname.to_s]
  end

end
to_mongo() click to toggle source
# File lib/alexa/container.rb, line 10
def to_mongo
  self.class.to_mongo(self)
end