LoginSignup
0
0

More than 5 years have passed since last update.

第5回つぶやき勉強会

Posted at
1 / 4
class Hoge  
  def hoge
    1
  end

  @@piyo = Proc.new { hoge }

  def fuga
    @@piyo.call
  end
end

Hoge.new.fuga => # これはなんですか?

class Hoge
  def hoge
    Piyo.set
    @v
  end

  class Piyo
    def self.set
      @v = 2
    end
  end
end

Hoge.new.hoge => # これはなんですか?

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0