Class: Hipmost::Mattermost::Team
- Inherits:
-
Object
- Object
- Hipmost::Mattermost::Team
- Defined in:
- lib/hipmost/mattermost/team.rb
Instance Attribute Summary collapse
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
Instance Method Summary collapse
-
#initialize(display_name) ⇒ Team
constructor
A new instance of Team.
- #name ⇒ Object
- #to_jsonl ⇒ Object
Constructor Details
#initialize(display_name) ⇒ Team
Returns a new instance of Team.
4 5 6 |
# File 'lib/hipmost/mattermost/team.rb', line 4 def initialize(display_name) @display_name = display_name end |
Instance Attribute Details
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
7 8 9 |
# File 'lib/hipmost/mattermost/team.rb', line 7 def display_name @display_name end |
Instance Method Details
#name ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/hipmost/mattermost/team.rb', line 13 def name if display_name == "Orbital Impact" "oi" else @display_name.gsub(/\s/, "-").downcase end end |
#to_jsonl ⇒ Object
9 10 11 |
# File 'lib/hipmost/mattermost/team.rb', line 9 def to_jsonl %[{ "type": "team", "team": { "display_name": "#@display_name", "name": "#{name}", "type": "I", "description": "#@display_name", "allow_open_invite": false } }] end |