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
219 220 221 222 |
# File 'lib/jsduck/class.rb', line 219 def initialize(str, exists=true) super(str) @exists = exists end |
Instance Method Details
#exists? ⇒ Boolean
224 225 226 |
# File 'lib/jsduck/class.rb', line 224 def exists? @exists end |