Class: Steep::AST::Signature::Members::Method
- Inherits:
-
Object
- Object
- Steep::AST::Signature::Members::Method
- Defined in:
- lib/steep/ast/signature/members.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#types ⇒ Object
readonly
Returns the value of attribute types.
Instance Method Summary collapse
- #constructor? ⇒ Boolean
- #incompatible? ⇒ Boolean
-
#initialize(location:, name:, kind:, types:, attributes:) ⇒ Method
constructor
A new instance of Method.
- #instance_method? ⇒ Boolean
- #module_method? ⇒ Boolean
- #private? ⇒ Boolean
Constructor Details
#initialize(location:, name:, kind:, types:, attributes:) ⇒ Method
Returns a new instance of Method.
36 37 38 39 40 41 42 |
# File 'lib/steep/ast/signature/members.rb', line 36 def initialize(location:, name:, kind:, types:, attributes:) @location = location @name = name @kind = kind @types = types @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
34 35 36 |
# File 'lib/steep/ast/signature/members.rb', line 34 def attributes @attributes end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
32 33 34 |
# File 'lib/steep/ast/signature/members.rb', line 32 def kind @kind end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
30 31 32 |
# File 'lib/steep/ast/signature/members.rb', line 30 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/steep/ast/signature/members.rb', line 31 def name @name end |
#types ⇒ Object (readonly)
Returns the value of attribute types.
33 34 35 |
# File 'lib/steep/ast/signature/members.rb', line 33 def types @types end |
Instance Method Details
#constructor? ⇒ Boolean
52 53 54 |
# File 'lib/steep/ast/signature/members.rb', line 52 def constructor? attributes.include?(:constructor) end |
#incompatible? ⇒ Boolean
56 57 58 |
# File 'lib/steep/ast/signature/members.rb', line 56 def incompatible? attributes.include?(:incompatible) end |
#instance_method? ⇒ Boolean
48 49 50 |
# File 'lib/steep/ast/signature/members.rb', line 48 def instance_method? kind == :instance || kind == :module_instance end |
#module_method? ⇒ Boolean
44 45 46 |
# File 'lib/steep/ast/signature/members.rb', line 44 def module_method? kind == :module || kind == :module_instance end |
#private? ⇒ Boolean
60 61 62 |
# File 'lib/steep/ast/signature/members.rb', line 60 def private? attributes.include?(:private) end |