Class: RubyRabbitmqJanus::Tools::Type
- Inherits:
-
Object
- Object
- RubyRabbitmqJanus::Tools::Type
- Defined in:
- lib/rrj/tools/replaces/type.rb
Overview
Class for converting elemnts 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
Initalize an object for cast a type to data given by app.
Constructor Details
#initialize(request) ⇒ Type
Initalize an object for cast a type to data given by app
17 18 19 20 21 22 |
# File 'lib/rrj/tools/replaces/type.rb', line 17 def initialize(request) @request = request @key = @data = nil rescue raise Errors::Tools::Type::Initializer end |
Instance Method Details
#convert(key, option = {}) ⇒ Object
Return an data with a type corresponding to string in request
30 31 32 33 34 35 36 |
# File 'lib/rrj/tools/replaces/type.rb', line 30 def convert(key, option = {}) @key = key @data = option[@key] if option.key?(@key) convert_data rescue raise Errors::Tools::Type::Convert end |