Class: ReverseProxy::Bind::Formatter
- Inherits:
-
Object
- Object
- ReverseProxy::Bind::Formatter
- Defined in:
- lib/reverse_proxy/bind.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
#initialize(data) ⇒ Formatter
Returns a new instance of Formatter.
13 14 15 |
# File 'lib/reverse_proxy/bind.rb', line 13 def initialize data @data = data end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method) ⇒ Object (private)
20 21 22 23 |
# File 'lib/reverse_proxy/bind.rb', line 20 def method_missing method return @bind.send method if @bind.respond_to? method format("#{method}".scan(/^to_([a-z]+)/)[0][0]) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
12 13 14 |
# File 'lib/reverse_proxy/bind.rb', line 12 def data @data end |
Class Method Details
.add(type, format) ⇒ Object
5 6 7 |
# File 'lib/reverse_proxy/bind.rb', line 5 def add type, format formats[type.to_s] = format end |
.formats ⇒ Object
8 9 10 |
# File 'lib/reverse_proxy/bind.rb', line 8 def formats @@formats ||= {} end |