Class: RBS::Definition::Method::TypeDef
- Inherits:
-
Object
- Object
- RBS::Definition::Method::TypeDef
- Defined in:
- lib/rbs/definition.rb
Instance Attribute Summary collapse
-
#defined_in ⇒ Object
readonly
Returns the value of attribute defined_in.
-
#implemented_in ⇒ Object
readonly
Returns the value of attribute implemented_in.
-
#member ⇒ Object
readonly
Returns the value of attribute member.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #annotations ⇒ Object
- #comment ⇒ Object
-
#initialize(type:, member:, defined_in:, implemented_in:) ⇒ TypeDef
constructor
A new instance of TypeDef.
- #overload? ⇒ Boolean
- #update(type: self.type, member: self.member, defined_in: self.defined_in, implemented_in: self.implemented_in) ⇒ Object
Constructor Details
#initialize(type:, member:, defined_in:, implemented_in:) ⇒ TypeDef
Returns a new instance of TypeDef.
30 31 32 33 34 35 |
# File 'lib/rbs/definition.rb', line 30 def initialize(type:, member:, defined_in:, implemented_in:) @type = type @member = member @defined_in = defined_in @implemented_in = implemented_in end |
Instance Attribute Details
#defined_in ⇒ Object (readonly)
Returns the value of attribute defined_in.
27 28 29 |
# File 'lib/rbs/definition.rb', line 27 def defined_in @defined_in end |
#implemented_in ⇒ Object (readonly)
Returns the value of attribute implemented_in.
28 29 30 |
# File 'lib/rbs/definition.rb', line 28 def implemented_in @implemented_in end |
#member ⇒ Object (readonly)
Returns the value of attribute member.
26 27 28 |
# File 'lib/rbs/definition.rb', line 26 def member @member end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
25 26 27 |
# File 'lib/rbs/definition.rb', line 25 def type @type end |
Instance Method Details
#annotations ⇒ Object
41 42 43 |
# File 'lib/rbs/definition.rb', line 41 def annotations member.annotations end |
#comment ⇒ Object
37 38 39 |
# File 'lib/rbs/definition.rb', line 37 def comment member.comment end |
#overload? ⇒ Boolean
49 50 51 52 53 54 55 56 |
# File 'lib/rbs/definition.rb', line 49 def overload? case mem = member when AST::Members::MethodDefinition mem.overload? else false end end |
#update(type: self.type, member: self.member, defined_in: self.defined_in, implemented_in: self.implemented_in) ⇒ Object
45 46 47 |
# File 'lib/rbs/definition.rb', line 45 def update(type: self.type, member: self.member, defined_in: self.defined_in, implemented_in: self.implemented_in) TypeDef.new(type: type, member: member, defined_in: defined_in, implemented_in: implemented_in) end |