Class: Yoda::Model::FunctionSignatures::TypeBuilder::TypeParser
- Inherits:
-
Object
- Object
- Yoda::Model::FunctionSignatures::TypeBuilder::TypeParser
- Defined in:
- lib/yoda/model/function_signatures/type_builder.rb
Instance Attribute Summary collapse
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Instance Method Summary collapse
-
#initialize(tag) ⇒ TypeParser
constructor
A new instance of TypeParser.
- #type ⇒ TypeExpressions::Base
- #type_of_type_tag ⇒ TypeExpressions::Base
Constructor Details
#initialize(tag) ⇒ TypeParser
Returns a new instance of TypeParser.
103 104 105 |
# File 'lib/yoda/model/function_signatures/type_builder.rb', line 103 def initialize(tag) @tag = tag end |
Instance Attribute Details
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
100 101 102 |
# File 'lib/yoda/model/function_signatures/type_builder.rb', line 100 def tag @tag end |
Instance Method Details
#type ⇒ TypeExpressions::Base
108 109 110 111 112 113 114 115 |
# File 'lib/yoda/model/function_signatures/type_builder.rb', line 108 def type # yard tag may not have any type literals. if (tag.yard_types || []).empty? TypeExpressions::UnknownType.new('nodoc') else TypeExpressions.parse_type_strings(tag.yard_types).change_root(convert_lexical_scope_literals(tag.lexical_scope)) end end |
#type_of_type_tag ⇒ TypeExpressions::Base
118 119 120 |
# File 'lib/yoda/model/function_signatures/type_builder.rb', line 118 def type_of_type_tag Parsing::TypeParser.new.safe_parse(tag.text).change_root(convert_lexical_scope_literals(tag.lexical_scope)) end |