Exception: RBS::InconsistentMethodVisibilityError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rbs/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type_name:, method_name:, kind:, member_pairs:) ⇒ InconsistentMethodVisibilityError

Returns a new instance of InconsistentMethodVisibilityError.



275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/rbs/errors.rb', line 275

def initialize(type_name:, method_name:, kind:, member_pairs:)
  @type_name = type_name
  @method_name = method_name
  @kind = kind
  @member_pairs = member_pairs

  delimiter = case kind
              when :instance
                "#"
              when :singleton
                "."
              end

  super "#{Location.to_string member_pairs[0][0].location}: Inconsistent method visibility: #{type_name}#{delimiter}#{method_name}"
end

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind.



272
273
274
# File 'lib/rbs/errors.rb', line 272

def kind
  @kind
end

#member_pairsObject (readonly)

Returns the value of attribute member_pairs.



273
274
275
# File 'lib/rbs/errors.rb', line 273

def member_pairs
  @member_pairs
end

#method_nameObject (readonly)

Returns the value of attribute method_name.



271
272
273
# File 'lib/rbs/errors.rb', line 271

def method_name
  @method_name
end

#type_nameObject (readonly)

Returns the value of attribute type_name.



270
271
272
# File 'lib/rbs/errors.rb', line 270

def type_name
  @type_name
end