Class: Hash

Inherits:
Object
  • Object
show all
Includes:
ISFSObject
Defined in:
lib/smartfox_jruby/common.rb

Instance Method Summary collapse

Methods included from ISFSObject

#to_hash, #to_s

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args) ⇒ Object



118
119
120
121
122
123
124
125
# File 'lib/smartfox_jruby/common.rb', line 118

def method_missing(m, *args)
  sfs_object = SFSObject.from_hash(self)
  if sfs_object.respond_to?(m)
    sfs_object.send(m, *args)
  else
    super
  end
end

Instance Method Details

#to_sfsobject(opts = {}) ⇒ Object



114
115
116
# File 'lib/smartfox_jruby/common.rb', line 114

def to_sfsobject(opts = {})
  SFSObject.from_hash(self, opts)
end