Class: Clearbit::Slack::Attachments::Person

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/clearbit/slack/attachments/person.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#aboutme, #angellist, #facebook, #field, #format_number, #github, #link, #linkedin, #twitter

Constructor Details

#initialize(person) ⇒ Person

Returns a new instance of Person.



8
9
10
# File 'lib/clearbit/slack/attachments/person.rb', line 8

def initialize(person)
  @person = person
end

Instance Attribute Details

#personObject (readonly)

Returns the value of attribute person.



6
7
8
# File 'lib/clearbit/slack/attachments/person.rb', line 6

def person
  @person
end

Instance Method Details

#as_json(options = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/clearbit/slack/attachments/person.rb', line 12

def as_json(options = {})
  {
    fallback: fallback,
    author_name: person.name.full_name,
    author_icon: person.avatar,
    text: person.bio,
    color: color,
    fields: fields.compact
  }
end