Class: Hash
- Inherits:
-
Object
show all
- Defined in:
- lib/httpclient/httpclient.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
25
26
27
28
|
# File 'lib/httpclient/httpclient.rb', line 25
def method_missing( name, *args )
return self[name.to_s] if self[name.to_s]
super( name, *args )
end
|
Instance Method Details
#desym! ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/httpclient/httpclient.rb', line 17
def desym!
r = Hash.new
self.each do |k, v|
r[k.to_s]=v.to_s
end
self.replace(r)
end
|
#to_s ⇒ Object
9
10
11
12
13
14
15
|
# File 'lib/httpclient/httpclient.rb', line 9
def to_s
s = "{ "
self.each{ |k, v| s << "#{k} => #{v}, " }
s.chop!
s.chop!
s << " }"
end
|