Class: JsDuck::ClassNameString
- Inherits:
-
String
- Object
- String
- JsDuck::ClassNameString
- Defined in:
- lib/jsduck/class.rb
Overview
String class for classnames that has extra method #exists? which returns false when class with such name doesn’t exist.
This ability is used by JsDuck::Renderer, which only receives names of various classes but needs to only render existing classes as links.
Instance Method Summary collapse
- #exists? ⇒ Boolean
-
#initialize(str, exists = true) ⇒ ClassNameString
constructor
A new instance of ClassNameString.
Constructor Details
#initialize(str, exists = true) ⇒ ClassNameString
Returns a new instance of ClassNameString.
341 342 343 344 |
# File 'lib/jsduck/class.rb', line 341 def initialize(str, exists=true) super(str) @exists = exists end |
Instance Method Details
#exists? ⇒ Boolean
346 347 348 |
# File 'lib/jsduck/class.rb', line 346 def exists? @exists end |