Class: Clearbit::Slack::Attachments::Person
- Inherits:
-
Object
- Object
- Clearbit::Slack::Attachments::Person
- Includes:
- Helpers
- Defined in:
- lib/clearbit/slack/attachments/person.rb
Instance Attribute Summary collapse
-
#person ⇒ Object
readonly
Returns the value of attribute person.
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(person) ⇒ Person
constructor
A new instance of Person.
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
#person ⇒ Object (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( = {}) { fallback: fallback, author_name: person.name.full_name, author_icon: person.avatar, text: person.bio, color: color, fields: fields.compact } end |