This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
catch (:escape) do | |
loop do | |
puts 'loop1' | |
loop do | |
puts 'loop2' | |
throw (:escape, 'escape loop1 & loop2) | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ruby 2.3.0 | |
loop do | |
puts 'loop1' | |
loop do | |
puts 'loop2' | |
break | |
end | |
puts 'escape loop2' | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# catchの構文 | |
catch (tag) do | |
# tag => 終了する場ためのオブジェクト throwから送られてくるものと一致する必要がある。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module M | |
def hoge | |
puts 'hoge' | |
end | |
end | |
class C | |
include M | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module M | |
class hoge | |
puts 'hoge' | |
end | |
end | |
class C | |
prepend M | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module M1; end | |
module M2; end | |
class C | |
include M1 | |
prepend M2 | |
end | |
a = C.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module M | |
def hoge | |
puts 'hoge' | |
end | |
end | |
class C | |
extend M | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10分以内でおねがいします。 | |
部屋は就職資料室 15704でお願いします。 | |
鍵は事務室にあります。 | |
昼は避けてください。 | |
学校名と名前をよろしくおねがいします。 | |
自己PRをお願いします。 | |
学生時代に頑張ったことはなんですか? (気になることは深掘りありです。) | |
なぜ弊社を希望されましたか? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# apps/web/controllers/hoge/hoge.rb | |
module Web::Controllers::hoge | |
class Index | |
include Web::Action | |
expose :hoge #Viewと共有するインスタンス変数のシンボルを渡す | |
def call(params) | |
@hoge = 'Hello Hoge' # exposeに明示されているためViewに共有される。 | |
@huga = 'Hello Huga' # exposeに明示されていないためViewには共有されない。 | |
end |
OlderNewer