Class: RBS::Types::ClassInstance
- Inherits:
-
Object
- Object
- RBS::Types::ClassInstance
- 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:) ⇒ ClassInstance
constructor
A new instance of ClassInstance.
- #sub(s) ⇒ Object
- #to_json(*a) ⇒ Object
Methods included from Application
#==, #each_type, #free_variables, #hash, #to_s
Constructor Details
#initialize(name:, args:, location:) ⇒ ClassInstance
Returns a new instance of ClassInstance.
245 246 247 248 249 |
# File 'lib/rbs/types.rb', line 245 def initialize(name:, args:, location:) @name = name @args = args @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
241 242 243 |
# File 'lib/rbs/types.rb', line 241 def location @location end |
Instance Method Details
#sub(s) ⇒ Object
255 256 257 258 259 |
# File 'lib/rbs/types.rb', line 255 def sub(s) self.class.new(name: name, args: args.map {|ty| ty.sub(s) }, location: location) end |
#to_json(*a) ⇒ Object
251 252 253 |
# File 'lib/rbs/types.rb', line 251 def to_json(*a) { class: :class_instance, name: name, args: args, location: location }.to_json(*a) end |