Class: Mediaflux::TokenCreateRequest

Inherits:
Request
  • Object
show all
Defined in:
app/models/mediaflux/token_create_request.rb

Instance Attribute Summary

Attributes inherited from Request

#session_token

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Request

build_post_request, default_xml_namespace, default_xml_namespace_uri, #error?, find_or_create_http_client, format_date_for_mediaflux, request_path, #resolve, #resolved?, #response_body, #response_error, #response_xml, uri, #xml_payload, #xtoshell_xml

Constructor Details

#initialize(session_token:, domain:, user:) ⇒ TokenCreateRequest

Returns a new instance of TokenCreateRequest.



10
11
12
13
14
# File 'app/models/mediaflux/token_create_request.rb', line 10

def initialize(session_token:, domain:, user:)
  @domain = domain
  @user = user
  super(session_token: session_token)
end

Class Method Details

.serviceString

Specifies the logon service within the Mediaflux API

Returns:

  • (String)


6
7
8
# File 'app/models/mediaflux/token_create_request.rb', line 6

def self.service
  "secure.identity.token.create"
end

Instance Method Details

#identityObject



16
17
18
19
# File 'app/models/mediaflux/token_create_request.rb', line 16

def identity
  @id ||= response_xml.xpath("/response/reply/result/token").text.strip
  @id
end