Class: Bri::Search::Method
Direct Known Subclasses
Instance Attribute Summary collapse
-
#class_term ⇒ Object
readonly
Returns the value of attribute class_term.
-
#method_term ⇒ Object
readonly
Returns the value of attribute method_term.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(term) ⇒ Method
constructor
A new instance of Method.
- #search(type = :fully_qualified) ⇒ Object
Constructor Details
#initialize(term) ⇒ Method
Returns a new instance of Method.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/bri/search/method.rb', line 6 def initialize( term ) super @class_term, @method_term = term.split( /[\.#]/, 2 ) if @class_term !~ /^[A-Z]/ && !@method_term @method_term, @class_term = @class_term, @method_term end @class_term = nil if @class_term&.empty? end |
Instance Attribute Details
#class_term ⇒ Object (readonly)
Returns the value of attribute class_term.
4 5 6 |
# File 'lib/bri/search/method.rb', line 4 def class_term @class_term end |
#method_term ⇒ Object (readonly)
Returns the value of attribute method_term.
4 5 6 |
# File 'lib/bri/search/method.rb', line 4 def method_term @method_term end |
Instance Method Details
#search(type = :fully_qualified) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/bri/search/method.rb', line 17 def search( type = :fully_qualified ) case type when :fully_qualified then fully_qualified_search when :partially_qualified then partially_qualified_search when :unqualified then unqualified_search else :error # TODO: Error handling end end |