Class: Faas::User

Inherits:
Object
  • Object
show all
Defined in:
lib/faas.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash = nil) ⇒ User

Returns a new instance of User.



122
123
124
# File 'lib/faas.rb', line 122

def initialize(hash=nil)
  @hash = hash || {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args) ⇒ Object



126
127
128
129
130
131
132
133
# File 'lib/faas.rb', line 126

def method_missing(symbol, *args)
  key = symbol.to_s
  if args.empty? && @hash.has_key?(symbol.to_s)
    @hash[symbol.to_s]
  else
    super
  end
end