Class: Epuber::Book::NormalContributor

Inherits:
Contributor show all
Defined in:
lib/epuber/book/contributor.rb

Instance Attribute Summary collapse

Attributes inherited from Contributor

#role

Instance Method Summary collapse

Methods inherited from Contributor

from_obj

Constructor Details

#initialize(first_name, last_name, role) ⇒ NormalContributor

Returns a new instance of NormalContributor.

Parameters:

  • first_name (String)

    first name of contributor

  • last_name (String)

    last name of contributor

  • role (String)

    contributor role



73
74
75
76
77
78
# File 'lib/epuber/book/contributor.rb', line 73

def initialize(first_name, last_name, role)
  super(nil, nil, role)

  @first_name = first_name
  @last_name  = last_name
end

Instance Attribute Details

#first_nameString

Returns first name of contributor.

Returns:

  • (String)

    first name of contributor



62
63
64
# File 'lib/epuber/book/contributor.rb', line 62

def first_name
  @first_name
end

#last_nameString

Returns last name of contributor.

Returns:

  • (String)

    last name of contributor



66
67
68
# File 'lib/epuber/book/contributor.rb', line 66

def last_name
  @last_name
end

Instance Method Details

#file_asString

Returns:

  • (String)


88
89
90
# File 'lib/epuber/book/contributor.rb', line 88

def file_as
  "#{@last_name.mb_chars.upcase}, #{@first_name}"
end

#pretty_nameString

Returns:

  • (String)


82
83
84
# File 'lib/epuber/book/contributor.rb', line 82

def pretty_name
  "#{@first_name} #{@last_name}"
end