Class: Slk::Support::SlackUrlParser::Result

Inherits:
Data
  • Object
show all
Defined in:
lib/slk/support/slack_url_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#channel_idObject (readonly)

Returns the value of attribute channel_id

Returns:

  • (Object)

    the current value of channel_id



16
17
18
# File 'lib/slk/support/slack_url_parser.rb', line 16

def channel_id
  @channel_id
end

#msg_tsObject (readonly)

Returns the value of attribute msg_ts

Returns:

  • (Object)

    the current value of msg_ts



16
17
18
# File 'lib/slk/support/slack_url_parser.rb', line 16

def msg_ts
  @msg_ts
end

#thread_tsObject (readonly)

Returns the value of attribute thread_ts

Returns:

  • (Object)

    the current value of thread_ts



16
17
18
# File 'lib/slk/support/slack_url_parser.rb', line 16

def thread_ts
  @thread_ts
end

#workspaceObject (readonly)

Returns the value of attribute workspace

Returns:

  • (Object)

    the current value of workspace



16
17
18
# File 'lib/slk/support/slack_url_parser.rb', line 16

def workspace
  @workspace
end

Instance Method Details

#message?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/slk/support/slack_url_parser.rb', line 17

def message?
  !msg_ts.nil?
end

#thread?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/slk/support/slack_url_parser.rb', line 21

def thread?
  !thread_ts.nil?
end

#tsObject

Returns the thread parent timestamp if this URL points to a threaded message. Use this when fetching thread replies - pass this as the thread_ts parameter. Returns nil if the URL does not contain a thread_ts query parameter.



28
29
30
# File 'lib/slk/support/slack_url_parser.rb', line 28

def ts
  thread_ts
end