Sha256: 8a9ff44a820ec07690e30d8d4f0410357aad08219de57dd73e62c9b59fd8f003

Contents?: true

Size: 632 Bytes

Versions: 5

Compression:

Stored size: 632 Bytes

Contents

class Foo
  def initialize
    @foo = 42
  end

  private
  attr_accessor :foo

  public
  def get_foo
    foo
  end
  def set_foo(arg)
    self.foo = arg
  end
  def get_bar
    bar
  end
  def set_bar(arg)
    self.bar = arg
  end
end

Foo.new.set_foo("str")
Foo.new.set_bar("str")

__END__
# Errors
smoke/attr-vis.rb:20: [warning] inconsistent assignment to RBS-declared variable

# Classes
class Foo
  def initialize: -> void

  private
  attr_accessor foo: Integer | String

  public
  def get_foo: -> (Integer | String)
  def set_foo: (String arg) -> String
  def get_bar: -> Integer
  def set_bar: (String arg) -> String
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
typeprof-0.20.0 smoke/attr-vis.rb
typeprof-0.15.3 smoke/attr-vis.rb
typeprof-0.15.2 smoke/attr-vis.rb
typeprof-0.15.1 smoke/attr-vis.rb
typeprof-0.15.0 smoke/attr-vis.rb