Class: Steep::AST::Signature::Members::Method

Inherits:
Object
  • Object
show all
Defined in:
lib/steep/ast/signature/members.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject (readonly)

Returns the value of attribute attributes.



34
35
36
# File 'lib/steep/ast/signature/members.rb', line 34

def attributes
  @attributes
end

#kindObject (readonly)

Returns the value of attribute kind.



32
33
34
# File 'lib/steep/ast/signature/members.rb', line 32

def kind
  @kind
end

#locationObject (readonly)

Returns the value of attribute location.



30
31
32
# File 'lib/steep/ast/signature/members.rb', line 30

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



31
32
33
# File 'lib/steep/ast/signature/members.rb', line 31

def name
  @name
end

#typesObject (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

Returns:

  • (Boolean)


52
53
54
# File 'lib/steep/ast/signature/members.rb', line 52

def constructor?
  attributes.include?(:constructor)
end

#incompatible?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/steep/ast/signature/members.rb', line 56

def incompatible?
  attributes.include?(:incompatible)
end

#instance_method?Boolean

Returns:

  • (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

Returns:

  • (Boolean)


44
45
46
# File 'lib/steep/ast/signature/members.rb', line 44

def module_method?
  kind == :module || kind == :module_instance
end

#private?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/steep/ast/signature/members.rb', line 60

def private?
  attributes.include?(:private)
end