Class: RbsActiverecord::Parser::IncludeExpander::Module
- Inherits:
-
Object
- Object
- RbsActiverecord::Parser::IncludeExpander::Module
- Defined in:
- lib/rbs_activerecord/parser/include_expander/module.rb
Instance Attribute Summary collapse
-
#mod ⇒ Object
readonly
: ::Module.
-
#name ⇒ Object
readonly
: String.
Instance Method Summary collapse
-
#concern? ⇒ Boolean
: bool.
-
#included_blocks ⇒ Object
: Array.
-
#initialize(mod, name) ⇒ Module
constructor
A new instance of Module.
Constructor Details
#initialize(mod, name) ⇒ Module
Returns a new instance of Module.
12 13 14 15 |
# File 'lib/rbs_activerecord/parser/include_expander/module.rb', line 12 def initialize(mod, name) #: void @mod = mod @name = name end |
Instance Attribute Details
#mod ⇒ Object (readonly)
: ::Module
7 8 9 |
# File 'lib/rbs_activerecord/parser/include_expander/module.rb', line 7 def mod @mod end |
#name ⇒ Object (readonly)
: String
8 9 10 |
# File 'lib/rbs_activerecord/parser/include_expander/module.rb', line 8 def name @name end |
Instance Method Details
#concern? ⇒ Boolean
: bool
17 18 19 |
# File 'lib/rbs_activerecord/parser/include_expander/module.rb', line 17 def concern? #: bool mod.is_a?(::ActiveSupport::Concern) end |
#included_blocks ⇒ Object
: Array
21 22 23 24 25 |
# File 'lib/rbs_activerecord/parser/include_expander/module.rb', line 21 def included_blocks #: Array[Prism::CallNode] return [] unless concern? declarations.select { |node| node.name == :included } end |