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.
208 209 210 211 |
# File 'lib/jsduck/class.rb', line 208 def initialize(str, exists=true) super(str) @exists = exists end |
Instance Method Details
#exists? ⇒ Boolean
213 214 215 |
# File 'lib/jsduck/class.rb', line 213 def exists? @exists end |