Class: Shaf::Yard::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/shaf/yard/parser.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Parser

Returns a new instance of Parser.



10
11
12
# File 'lib/shaf/yard/parser.rb', line 10

def initialize(name)
  @name = name.downcase
end

Class Method Details

.call(name: '') ⇒ Object



6
7
8
# File 'lib/shaf/yard/parser.rb', line 6

def self.call(name: '')
  new(name).parse!
end

Instance Method Details

#parse!Object



14
15
16
17
# File 'lib/shaf/yard/parser.rb', line 14

def parse!
  verify_exists! unless name.empty?
  ::YARD.parse pattern
end