Class: Ogam::Signature

Inherits:
Object
  • Object
show all
Defined in:
lib/ogam/signature.rb

Overview

Methods relating to signatures

Class Method Summary collapse

Class Method Details

.signature_html(name, job_title, organisation) ⇒ Object



17
18
19
20
# File 'lib/ogam/signature.rb', line 17

def self.signature_html(name, job_title, organisation)
  parts = [name, job_title, organisation].reject(&:blank?)
  "<p>#{parts.join("<br />")}</p><hr color=#5b3293 />"
end

.update_signature_command(user) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/ogam/signature.rb', line 6

def self.update_signature_command(user)
  email = user.fetch("primaryEmail")
  html = signature_html(
    user.fetch("name.fullName", nil),
    user.fetch("organizations.0.title", nil),
    user.fetch("organizations.0.name", nil)
  )

  "gam user #{email} signature \"#{html}\""
end