Class: TRuby::GenericTypeParser
- Inherits:
-
Object
- Object
- TRuby::GenericTypeParser
- Defined in:
- lib/t_ruby/generic_type_parser.rb
Instance Method Summary collapse
-
#initialize(type_string) ⇒ GenericTypeParser
constructor
A new instance of GenericTypeParser.
- #parse ⇒ Object
Constructor Details
#initialize(type_string) ⇒ GenericTypeParser
Returns a new instance of GenericTypeParser.
5 6 7 |
# File 'lib/t_ruby/generic_type_parser.rb', line 5 def initialize(type_string) @type_string = type_string.strip end |
Instance Method Details
#parse ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/t_ruby/generic_type_parser.rb', line 9 def parse if @type_string.include?("<") && @type_string.include?(">") parse_generic else { type: :simple, value: @type_string } end end |