class T7s::Idol::Name

Attributes

aka[R]
family[R]
family_kana[R]
given[R]
given_kana[R]
shorten[R]

Public Class Methods

new(name_object) click to toggle source
# File lib/t7s/idol/name.rb, line 6
def initialize(name_object)
  name_object.each do |k, v|
    instance_variable_set("@#{k}", v)
  end
end

Public Instance Methods

==(other) click to toggle source
Calls superclass method
# File lib/t7s/idol/name.rb, line 33
def ==(other)
  super || [aka, given, full].compact.include?(other)
end
full() click to toggle source
# File lib/t7s/idol/name.rb, line 17
def full
  if @family && @given
    "#{@family}#{@given}"
  else
    @aka
  end
end
full_kana() click to toggle source
# File lib/t7s/idol/name.rb, line 25
def full_kana
  if @family_kana && @given_kana
    "#{@family_kana}#{@given_kana}"
  else
    self.full
  end
end
to_s() click to toggle source
# File lib/t7s/idol/name.rb, line 12
def to_s
  return @aka if @aka
  full
end