Class: RubyRabbitmqJanus::Tools::Type
- Inherits:
-
Object
- Object
- RubyRabbitmqJanus::Tools::Type
- Defined in:
- lib/rrj/tools/replaces/type.rb
Overview
Class for converting elements given by apps to this gem an type conform to request sending
Instance Method Summary collapse
-
#convert(key, option = {}) ⇒ Object
Return an data with a type corresponding to string in request.
-
#initialize(request) ⇒ Type
constructor
Initialize an object for cast a type to data given by app.
Constructor Details
#initialize(request) ⇒ Type
Initialize an object for cast a type to data given by app
16 17 18 19 |
# File 'lib/rrj/tools/replaces/type.rb', line 16 def initialize(request) @request = request @key = @data = nil end |
Instance Method Details
#convert(key, option = {}) ⇒ Object
Return an data with a type corresponding to string in request
27 28 29 30 31 |
# File 'lib/rrj/tools/replaces/type.rb', line 27 def convert(key, option = {}) @key = key @data = option[@key] if option.key?(@key) convert_data end |