Class: Imasgen::Name

Inherits:
Object
  • Object
show all
Defined in:
lib/imasgen/name.rb

Defined Under Namespace

Classes: First, Last

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(namedata) ⇒ Name

Returns a new instance of Name.



8
9
10
11
12
# File 'lib/imasgen/name.rb', line 8

def initialize(namedata)
  @namedata = namedata
  @first = First.new(namedata)
  @last = Last.new(namedata)
end

Instance Attribute Details

#firstObject (readonly)

Returns the value of attribute first.



6
7
8
# File 'lib/imasgen/name.rb', line 6

def first
  @first
end

#lastObject (readonly)

Returns the value of attribute last.



6
7
8
# File 'lib/imasgen/name.rb', line 6

def last
  @last
end

Instance Method Details

#hiraganaObject



26
27
28
# File 'lib/imasgen/name.rb', line 26

def hiragana
  "#{@last.hiragana} #{@first.hiragana}"
end

#kanjiObject



22
23
24
# File 'lib/imasgen/name.rb', line 22

def kanji
  "#{@last.kanji} #{@first.kanji}"
end

#katakanaObject



30
31
32
# File 'lib/imasgen/name.rb', line 30

def katakana
  "#{@last.katakana} #{@first.katakana}"
end

#romajiObject



34
35
36
# File 'lib/imasgen/name.rb', line 34

def romaji
  "#{@first.romaji} #{@last.romaji}"
end

#to_sObject



14
15
16
# File 'lib/imasgen/name.rb', line 14

def to_s
  kanji
end

#to_strObject



18
19
20
# File 'lib/imasgen/name.rb', line 18

def to_str
  kanji
end