Class: Slk::Models::ProfileField
- Inherits:
-
Data
- Object
- Data
- Slk::Models::ProfileField
- Defined in:
- lib/slk/models/profile_field.rb
Overview
A single custom profile field from users.profile.get + team.profile.get schema.
‘value` is the raw string from Slack: a date as YYYY-MM-DD for type:date, a comma-separated list of user IDs for type:user, a URL for type:link. `alt` is Slack’s optional display label (e.g. link text).
Instance Attribute Summary collapse
-
#alt ⇒ Object
readonly
Returns the value of attribute alt.
-
#hidden ⇒ Object
readonly
Returns the value of attribute hidden.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#inverse ⇒ Object
readonly
Returns the value of attribute inverse.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#ordering ⇒ Object
readonly
Returns the value of attribute ordering.
-
#section_id ⇒ Object
readonly
Returns the value of attribute section_id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #empty? ⇒ Boolean
- #link_text ⇒ Object
-
#user_ids ⇒ Object
type:user values can be multi-value (comma-separated user IDs).
Instance Attribute Details
#alt ⇒ Object (readonly)
Returns the value of attribute alt
10 11 12 |
# File 'lib/slk/models/profile_field.rb', line 10 def alt @alt end |
#hidden ⇒ Object (readonly)
Returns the value of attribute hidden
10 11 12 |
# File 'lib/slk/models/profile_field.rb', line 10 def hidden @hidden end |
#id ⇒ Object (readonly)
Returns the value of attribute id
10 11 12 |
# File 'lib/slk/models/profile_field.rb', line 10 def id @id end |
#inverse ⇒ Object (readonly)
Returns the value of attribute inverse
10 11 12 |
# File 'lib/slk/models/profile_field.rb', line 10 def inverse @inverse end |
#label ⇒ Object (readonly)
Returns the value of attribute label
10 11 12 |
# File 'lib/slk/models/profile_field.rb', line 10 def label @label end |
#ordering ⇒ Object (readonly)
Returns the value of attribute ordering
10 11 12 |
# File 'lib/slk/models/profile_field.rb', line 10 def ordering @ordering end |
#section_id ⇒ Object (readonly)
Returns the value of attribute section_id
10 11 12 |
# File 'lib/slk/models/profile_field.rb', line 10 def section_id @section_id end |
#type ⇒ Object (readonly)
Returns the value of attribute type
10 11 12 |
# File 'lib/slk/models/profile_field.rb', line 10 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value
10 11 12 |
# File 'lib/slk/models/profile_field.rb', line 10 def value @value end |
Instance Method Details
#empty? ⇒ Boolean
13 14 15 |
# File 'lib/slk/models/profile_field.rb', line 13 def empty? value.to_s.empty? end |
#link_text ⇒ Object
24 25 26 |
# File 'lib/slk/models/profile_field.rb', line 24 def link_text alt.to_s.empty? ? value.to_s : alt.to_s end |
#user_ids ⇒ Object
type:user values can be multi-value (comma-separated user IDs).
18 19 20 21 22 |
# File 'lib/slk/models/profile_field.rb', line 18 def user_ids return [] unless type == 'user' value.to_s.split(',').map(&:strip).reject(&:empty?) end |