Class: Poke

Inherits:
Object
  • Object
show all
Defined in:
yard_sample.rb

Overview

あいさつをするためのクラス #

Author

ryopeko

Version

0.0.1

License

Ruby License

Constant Summary

VERSION =

このクラスのVersion

'0.0.1'

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Poke) initialize(user_name = 'you')

Pokeインスタンス

Parameters:

  • user_name (String) (defaults to: 'you')

    読者の名前



23
24
25
26
# File 'yard_sample.rb', line 23

def initialize(user_name='you')
  @reader = user_name
  @authors = %w(sugamasao takkanm hibariya ryopeko)
end

Instance Attribute Details

- (Object) authors (readonly)

著者名が格納される



14
15
16
# File 'yard_sample.rb', line 14

def authors
  @authors
end

- (Object) reader

読者名が格納される



11
12
13
# File 'yard_sample.rb', line 11

def reader
  @reader
end

Instance Method Details

- (String) english(name = @reader)

英語のあいさつ文

Parameters:

  • name (String) (defaults to: @reader)

    あいさつする人の名前

Returns:

  • (String)

    英語のあいさつ文



30
31
32
# File 'yard_sample.rb', line 30

def english(name=@reader)
  "Hello #{name}"
end