Class: Hashira::Analysis::Definition
- Inherits:
-
Data
- Object
- Data
- Hashira::Analysis::Definition
- Defined in:
- lib/hashira/analysis/definition.rb
Instance Attribute Summary collapse
-
#folder ⇒ Object
readonly
Returns the value of attribute folder.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #counted? ⇒ Boolean
- #klass? ⇒ Boolean
- #name ⇒ Object
- #nested? ⇒ Boolean
- #singular? ⇒ Boolean
- #superclass ⇒ Object
Instance Attribute Details
#folder ⇒ Object (readonly)
Returns the value of attribute folder
7 8 9 |
# File 'lib/hashira/analysis/definition.rb', line 7 def folder @folder end |
#node ⇒ Object (readonly)
Returns the value of attribute node
7 8 9 |
# File 'lib/hashira/analysis/definition.rb', line 7 def node @node end |
#path ⇒ Object (readonly)
Returns the value of attribute path
7 8 9 |
# File 'lib/hashira/analysis/definition.rb', line 7 def path @path end |
Instance Method Details
#counted? ⇒ Boolean
19 |
# File 'lib/hashira/analysis/definition.rb', line 19 def counted? = klass? || !Hashira::Analysis::Syntax.direct(node).empty? |
#klass? ⇒ Boolean
13 |
# File 'lib/hashira/analysis/definition.rb', line 13 def klass? = node.is_a?(Prism::ClassNode) |
#name ⇒ Object
9 |
# File 'lib/hashira/analysis/definition.rb', line 9 def name = path.first |
#nested? ⇒ Boolean
11 |
# File 'lib/hashira/analysis/definition.rb', line 11 def nested? = path.length > 1 |
#singular? ⇒ Boolean
15 |
# File 'lib/hashira/analysis/definition.rb', line 15 def singular? = klass? && !nested? |
#superclass ⇒ Object
17 |
# File 'lib/hashira/analysis/definition.rb', line 17 def superclass = node.superclass |