Class: TRMNL::API::Configuration::Content

Inherits:
Struct
  • Object
show all
Defined in:
lib/trmnl/api/configuration/content.rb

Overview

Provides API client configuration content.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#content_typeObject

Returns the value of attribute content_type

Returns:

  • (Object)

    the current value of content_type



9
10
11
# File 'lib/trmnl/api/configuration/content.rb', line 9

def content_type
  @content_type
end

#timeout_connectObject

Returns the value of attribute timeout_connect

Returns:

  • (Object)

    the current value of timeout_connect



9
10
11
# File 'lib/trmnl/api/configuration/content.rb', line 9

def timeout_connect
  @timeout_connect
end

#timeout_readObject

Returns the value of attribute timeout_read

Returns:

  • (Object)

    the current value of timeout_read



9
10
11
# File 'lib/trmnl/api/configuration/content.rb', line 9

def timeout_read
  @timeout_read
end

#timeout_writeObject

Returns the value of attribute timeout_write

Returns:

  • (Object)

    the current value of timeout_write



9
10
11
# File 'lib/trmnl/api/configuration/content.rb', line 9

def timeout_write
  @timeout_write
end

#uriObject

Returns the value of attribute uri

Returns:

  • (Object)

    the current value of uri



9
10
11
# File 'lib/trmnl/api/configuration/content.rb', line 9

def uri
  @uri
end

#user_agentObject

Returns the value of attribute user_agent

Returns:

  • (Object)

    the current value of user_agent



9
10
11
# File 'lib/trmnl/api/configuration/content.rb', line 9

def user_agent
  @user_agent
end

Instance Method Details

#headersObject



17
18
19
20
# File 'lib/trmnl/api/configuration/content.rb', line 17

def headers
  agent = " (#{user_agent})" if user_agent
  {content_type: content_type, user_agent: "http.rb/#{HTTP::VERSION}#{agent}"}.compact
end

#timeoutObject



22
# File 'lib/trmnl/api/configuration/content.rb', line 22

def timeout = {connect: timeout_connect, read: timeout_read, write: timeout_write}