Class: ChatSDK::Mattermost::AttachmentRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/chat_sdk/mattermost/attachment_renderer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(integration_url: nil) ⇒ AttachmentRenderer

Returns a new instance of AttachmentRenderer.



8
9
10
# File 'lib/chat_sdk/mattermost/attachment_renderer.rb', line 8

def initialize(integration_url: nil)
  @integration_url = integration_url
end

Instance Attribute Details

#integration_url=(value) ⇒ Object (writeonly)

Sets the attribute integration_url

Parameters:

  • value

    the value to set the attribute integration_url to.



6
7
8
# File 'lib/chat_sdk/mattermost/attachment_renderer.rb', line 6

def integration_url=(value)
  @integration_url = value
end

Instance Method Details

#render(node) ⇒ Object



12
13
14
15
16
17
# File 'lib/chat_sdk/mattermost/attachment_renderer.rb', line 12

def render(node)
  case node.type
  when :card then render_card(node)
  else wrap_attachment(render_node(node))
  end
end