Class: RETS4R::Client::MetadataRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/rets4r/client/metadata_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri, type, id, format, request_struct) ⇒ MetadataRequest

Returns a new instance of MetadataRequest.


5
6
7
8
9
10
11
# File 'lib/rets4r/client/metadata_request.rb', line 5

def initialize(uri, type, id, format, request_struct)
  @uri = uri
  @type = type
  @id = id
  @format = format
  @request_struct = request_struct
end

Instance Attribute Details

#clientObject

Returns the value of attribute client


4
5
6
# File 'lib/rets4r/client/metadata_request.rb', line 4

def client
  @client
end

#methodObject

Returns the value of attribute method


4
5
6
# File 'lib/rets4r/client/metadata_request.rb', line 4

def method
  @method
end

#retry_authObject

Returns the value of attribute retry_auth


4
5
6
# File 'lib/rets4r/client/metadata_request.rb', line 4

def retry_auth
  @retry_auth
end

#uriObject

Returns the value of attribute uri


4
5
6
# File 'lib/rets4r/client/metadata_request.rb', line 4

def uri
  @uri
end

Instance Method Details

#dataObject


15
16
17
18
19
20
21
# File 'lib/rets4r/client/metadata_request.rb', line 15

def data
  {
    'Type'   => @type,
    'ID'     => @id,
    'Format' => @format
  }
end

#headerObject


22
23
24
# File 'lib/rets4r/client/metadata_request.rb', line 22

def header
  { 'Accept' => 'text/xml,text/plain;q=0.5' }
end

#requestObject


12
13
14
# File 'lib/rets4r/client/metadata_request.rb', line 12

def request
  @request_struct.request(uri, data, header)
end