Class: Interfacets::Server::Assets::Classifier
- Inherits:
-
Object
- Object
- Interfacets::Server::Assets::Classifier
- Defined in:
- lib/interfacets/server/assets.rb
Defined Under Namespace
Classes: Visitor
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
- #consts ⇒ Object
-
#initialize(code) ⇒ Classifier
constructor
A new instance of Classifier.
- #visitor ⇒ Object
Constructor Details
#initialize(code) ⇒ Classifier
Returns a new instance of Classifier.
58 59 60 |
# File 'lib/interfacets/server/assets.rb', line 58 def initialize(code) @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
57 58 59 |
# File 'lib/interfacets/server/assets.rb', line 57 def code @code end |
Instance Method Details
#consts ⇒ Object
62 63 64 65 66 67 |
# File 'lib/interfacets/server/assets.rb', line 62 def consts @consts ||= ( Prism.parse(code).value.accept(visitor) visitor.mods.map(&:last) ) end |