Module: Artworker::Artist::InstanceMethods

Defined in:
lib/artworker/artist.rb

Instance Method Summary collapse

Instance Method Details

#datesObject



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/artworker/artist.rb', line 39

def dates
  if !self.birth.blank?
    if !self.death.blank?
      "#{self.birth} - #{self.death}"
    else
      "b. #{self.birth}"
    end
  elsif !self.death.blank?
    "d. #{self.death}"
  end
end

#fullnameObject



35
36
37
# File 'lib/artworker/artist.rb', line 35

def fullname
  "#{self.firstname} #{self.lastname}".strip
end

#fullname_with_datesObject



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/artworker/artist.rb', line 51

def fullname_with_dates
  if !fullname.blank?
    if !dates.blank?
      "#{fullname} (#{dates})"
    else
      "#{fullname}"
    end
  elsif !dates.blank?
    "#{dates}"
  end
end

#fullname_with_nationality_and_datesObject



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/artworker/artist.rb', line 63

def fullname_with_nationality_and_dates
  if !fullname.blank?
    if !self.nationality.blank?
      if !dates.blank?
        "#{fullname} (#{self.nationality}, #{dates})"
      else
        "#{fullname} (#{self.nationality})"
      end
    else
      "#{fullname_with_dates}"
    end
  elsif !self.nationality.blank?
    if !dates.blank?
      "#{self.nationality}, #{dates}"
    else
      "#{self.nationality}"
    end
  end
end