This file contains hidden or 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
| ## 材料 | |
| パスタ1〜2人前 | |
| にんにく1〜2かけ(好みで) | |
| 唐辛子1つ | |
| ## 調味料 | |
| 塩 |
This file contains hidden or 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
| ## 材料 | |
| 米2〜3合 | |
| 鶏もも肉1枚(切ってない奴 | |
| ## 調味料 | |
| 醤油(大さじ2杯弱) | |
| 塩(大さじ1杯) | |
| 酒(大さじ2杯) |
This file contains hidden or 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
| class X | |
| def self.method_added name | |
| p "method_added : #{name}" | |
| prepend(Module.new do | |
| eval <<EOS | |
| def #{name} | |
| p "homu" | |
| super | |
| end | |
| EOS |
This file contains hidden or 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 MethodAdded | |
| def method_added name | |
| p "method_added : #{name}" | |
| alias_method :homu, name | |
| super name | |
| end | |
| def self.prepended(klass) | |
| klass.extend self | |
| end |
This file contains hidden or 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
| class X | |
| def self.method_added name | |
| return if @flag | |
| @flag = true | |
| p "method_added : #{name}" | |
| alias_method "#{name}_impl", name | |
| define_method(name){ | |
| send "#{name}_impl" | |
| } | |
| @flag = false |
This file contains hidden or 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 StaticTyping | |
| def method_missing name, *types, &block | |
| define_method(name){ |*args| | |
| if types == args.map(&:class) | |
| block.call *args | |
| else | |
| throw "No match argument types." | |
| end | |
| } | |
| end |
This file contains hidden or 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
| " デフォルトでは結合文字の左右に " " をつける | |
| " 入力がなかった場合はスペースを挿入しないで結合する | |
| " , で結合する場合は ", " で結合する | |
| let g:jplus#input_config = { | |
| \ "__DEFAULT__" : { | |
| \ "delimiter_format" : " %d " | |
| \ }, | |
| \ "__EMPTY__" : { | |
| \ "delimiter_format" : "%d" | |
| \ }, |
This file contains hidden or 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
| class FileParser | |
| def parse name | |
| "Failed" | |
| end | |
| end | |
| module ParserCPP | |
| def parse name | |
| if name =~ /\.cpp$/ | |
| "C++ file" |
This file contains hidden or 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
| class X | |
| def my_to_s | |
| "X" | |
| end | |
| end | |
| class Object | |
| def to_callable to, from = :call | |
| obj = self |
This file contains hidden or 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 Output | |
| def puts output | |
| if output.class == Person | |
| super output.to_o | |
| else | |
| super output | |
| end | |
| end | |
| end |