Class: RBS::Types::Interface
- Inherits:
-
Object
- Object
- RBS::Types::Interface
- Includes:
- Application
- Defined in:
- lib/rbs/types.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Attributes included from Application
Instance Method Summary collapse
-
#initialize(name:, args:, location:) ⇒ Interface
constructor
A new instance of Interface.
- #sub(s) ⇒ Object
- #to_json(*a) ⇒ Object
Methods included from Application
#==, #each_type, #free_variables, #hash, #to_s
Constructor Details
#initialize(name:, args:, location:) ⇒ Interface
Returns a new instance of Interface.
223 224 225 226 227 |
# File 'lib/rbs/types.rb', line 223 def initialize(name:, args:, location:) @name = name @args = args @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
219 220 221 |
# File 'lib/rbs/types.rb', line 219 def location @location end |
Instance Method Details
#sub(s) ⇒ Object
233 234 235 236 237 |
# File 'lib/rbs/types.rb', line 233 def sub(s) self.class.new(name: name, args: args.map {|ty| ty.sub(s) }, location: location) end |
#to_json(*a) ⇒ Object
229 230 231 |
# File 'lib/rbs/types.rb', line 229 def to_json(*a) { class: :interface, name: name, args: args, location: location }.to_json(*a) end |