Class: Watchtower::Contact

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/watchtower/contact.rb

Defined Under Namespace

Modules: DataExtension

Instance Method Summary collapse

Instance Method Details

#full_nameObject



38
39
40
# File 'app/models/watchtower/contact.rb', line 38

def full_name
  [first_name, middle_name, last_name].compact.join(' ')
end

#nameObject



42
43
44
# File 'app/models/watchtower/contact.rb', line 42

def name
  full_name
end

#tag_namesObject



23
24
25
# File 'app/models/watchtower/contact.rb', line 23

def tag_names
  tags.map(&:to_s)
end

#tag_with(tag_name) ⇒ Object



50
51
52
# File 'app/models/watchtower/contact.rb', line 50

def tag_with(tag_name)
  taggings.create(tag: Tag.find_or_create_by_name(tag_name.try(:downcase)))
end

#to_sObject



46
47
48
# File 'app/models/watchtower/contact.rb', line 46

def to_s
  full_name
end