Class: Avmtrf1::Red::Profile

Inherits:
Object
  • Object
show all
Includes:
Helper, EacRubyUtils::SimpleCache
Defined in:
lib/avmtrf1/red/profile.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helper

#check_request_result, #http_client, #post, #post_xml, #xml_content, #xml_path

Constructor Details

#initialize(client, metadados) ⇒ Profile

Returns a new instance of Profile.

Parameters:


26
27
28
29
# File 'lib/avmtrf1/red/profile.rb', line 26

def initialize(client, metadados)
  @client = client
  @metadados = metadados.dup.freeze
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.


22
23
24
# File 'lib/avmtrf1/red/profile.rb', line 22

def client
  @client
end

#metadadosObject (readonly)

Returns the value of attribute metadados.


22
23
24
# File 'lib/avmtrf1/red/profile.rb', line 22

def metadados
  @metadados
end

Class Method Details

.by_ini_profile(ini_profile) ⇒ Object


14
15
16
17
18
19
# File 'lib/avmtrf1/red/profile.rb', line 14

def by_ini_profile(ini_profile)
  new(
    ::Avmtrf1::Red::Client.by_ini_profile(ini_profile),
    ini_profile.to_h('metadados.')
  )
end

Instance Method Details

#put_file(file_path) ⇒ Object


31
32
33
34
35
# File 'lib/avmtrf1/red/profile.rb', line 31

def put_file(file_path)
  auth_url = client.authorization_url
  infov 'Authorization URL', auth_url
  put_file_request(auth_url, file_path)
end

#serverObject


37
38
39
# File 'lib/avmtrf1/red/profile.rb', line 37

def server
  client.server
end