class Hipmost::Mattermost::Channel

Attributes

name[R]

Public Class Methods

from_hipchat(room, name:, team: ) click to toggle source
# File lib/hipmost/mattermost/channel.rb, line 4
def self.from_hipchat(room, name:, team: )
  new(name:          name,
      type:          room.private? ? "P" : "O",
      display_name:  room.display_name,
      header:        room.topic,
      team:          team)
end
new(name:, team:, display_name:, type:, header:) click to toggle source
# File lib/hipmost/mattermost/channel.rb, line 12
def initialize(name:, team:, display_name:, type:, header:)
  @name         = name.downcase.gsub(/\s/, "-")
  @team         = team
  @display_name = display_name
  @type         = type
  @header       = header
end

Public Instance Methods

to_jsonl() click to toggle source
# File lib/hipmost/mattermost/channel.rb, line 21
def to_jsonl
  %[{ "type": "channel", "channel": { "team": "#{@team.name}", "name": "#@name", "display_name": "#@display_name", "type": "#@type", "header": "#@header" } }]
end