Class: HelloWorld
- Inherits:
-
Object
- Object
- HelloWorld
- Defined in:
- yard_tags.rb
Overview
Callbacks (collapse)
Class Method Summary (collapse)
Instance Method Summary (collapse)
- - (Object) abstract_method abstract
-
- (Object) deprecated_method
deprecated
Deprecated.
このメソッドは非推奨です
- - (Object) example_method(arg = "arg_sample")
- - (Person?) find_friend(people = [])
- - (Object) hello_friends(message = "hello", friends = [])
- - (void) hello_joker1007 private
- - (void) hello_ryopeko private
- - (Object) hola(name = @reader)
- - (Object) japanese(name = @reader, option = {yobisute: true})
- - (Object) my_poke(lang, name = @reader)
- - (Object) note_method(arg = "arg_sample")
- - (Object) random_aisatsu(name = @reader, method_list = []) {|list| ... }
-
- (String) spanish(name = @reader)
スペイン語のあいさつ文.
Class Method Details
+ (Object) define_hello_method(name)
109 110 111 112 113 114 115 116 |
# File 'yard_tags.rb', line 109 def self.define_hello_method(name) instance_eval do define_method("hello_#{name}") do puts "Hello #{name}" end end private("hello_#{name}") end |
Instance Method Details
- (Object) abstract_method
This method is abstract.
抽象メソッドなのでoverrideしてください
10 11 12 |
# File 'yard_tags.rb', line 10 def abstract_method raise NotImplementedError end |
- (Object) after_filter
99 |
# File 'yard_tags.rb', line 99 def after_filter; end |
- (Object) before_filter
98 |
# File 'yard_tags.rb', line 98 def before_filter; end |
- (Object) deprecated_method
Deprecated.
このメソッドは非推奨です
15 16 17 |
# File 'yard_tags.rb', line 15 def deprecated_method puts "deprecated" end |
- (Object) example_method(arg = "arg_sample")
21 22 23 |
# File 'yard_tags.rb', line 21 def example_method(arg = "arg_sample") "example #{arg}" end |
- (Person?) find_friend(people = [])
71 72 73 |
# File 'yard_tags.rb', line 71 def find_friend(people = []) people.find(&:friend?) end |
- (Object) hello_friends(message = "hello", friends = [])
62 63 64 65 66 |
# File 'yard_tags.rb', line 62 def hello_friends( = "hello", friends = []) friends.each do |friend| puts "Hello #{friend}" end end |
- (void) hello_joker1007 (private)
Note:
joker1007に挨拶する
This method returns an undefined value.
118 |
# File 'yard_tags.rb', line 118 define_hello_method :joker1007 |
- (void) hello_ryopeko (private)
Note:
ryopekoに挨拶する
This method returns an undefined value.
119 |
# File 'yard_tags.rb', line 119 define_hello_method :ryopeko |
- (Object) hola(name = @reader)
76 77 78 |
# File 'yard_tags.rb', line 76 def hola(name = @reader) "Hola!! #{name}" end |
- (Object) japanese(name = @reader, option = {yobisute: true})
32 33 34 35 36 37 38 39 40 |
# File 'yard_tags.rb', line 32 def japanese(name = @reader, option = {yobisute: true}) aisatsu = 'こんにちは' keisyou = 'さま' aisatsu = 'ごきげんよう' if option[:type] == :ojou keisyou = '' if option[:yobisute] "#{aisatsu} #{name}#{keisyou}" end |
- (Object) my_poke(lang, name = @reader) - (Object) my_poke(lang, name = @reader)
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'yard_tags.rb', line 47 def my_poke(lang, name = @reader) case lang.to_sym when :ja japanese name when :en english name when :es spanish name else raise ArgumentError end end |
- (Object) note_method(arg = "arg_sample")
Note:
ここは大事な説明です
26 27 28 |
# File 'yard_tags.rb', line 26 def note_method(arg = "arg_sample") "hello #{arg}" end |
- (Object) random_aisatsu(name = @reader, method_list = []) {|list| ... }
90 91 92 93 94 |
# File 'yard_tags.rb', line 90 def random_aisatsu(name = @reader, method_list = [], &rule) method_list = [:english, :japanese, :spanish] if method_list.empty? select_method = yield method_list self.send select_method.to_sym, name end |
- (String) spanish(name = @reader)
スペイン語のあいさつ文
83 84 85 |
# File 'yard_tags.rb', line 83 def spanish(name = @reader) "Hola!! #{name}" end |