Class: RETS4R::Client::Transaction

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/rets4r/client/transaction.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(doc = nil) ⇒ Transaction

Returns a new instance of Transaction.



11
12
13
14
15
# File 'lib/rets4r/client/transaction.rb', line 11

def initialize(doc = nil)
  self.doc = doc || ResponseDocument::Base.new
  self.header = []
  self.delimiter = ?\t
end

Instance Attribute Details

#delimiterObject

Returns the value of attribute delimiter.



8
9
10
# File 'lib/rets4r/client/transaction.rb', line 8

def delimiter
  @delimiter
end

#docObject

Returns the value of attribute doc.



8
9
10
# File 'lib/rets4r/client/transaction.rb', line 8

def doc
  @doc
end

#headerObject

Returns the value of attribute header.



8
9
10
# File 'lib/rets4r/client/transaction.rb', line 8

def header
  @header
end

#metadataObject

Returns the value of attribute metadata.



8
9
10
# File 'lib/rets4r/client/transaction.rb', line 8

def 
  @metadata
end

#responseObject

Returns the value of attribute response.



8
9
10
# File 'lib/rets4r/client/transaction.rb', line 8

def response
  @response
end

#secondary_responseObject

Returns the value of attribute secondary_response.



8
9
10
# File 'lib/rets4r/client/transaction.rb', line 8

def secondary_response
  @secondary_response
end

Class Method Details

.deprecated_alias(old, new, msg = nil) ⇒ Object

:nodoc:



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/rets4r/client/transaction.rb', line 31

def deprecated_alias(old, new, msg = nil) # :nodoc:
  msg ||= "use \#{self.class}\##{new}"
  module_eval <<-"end;"
    def #{old}(*args, &block)
      if $VERBOSE
        warn("\#{caller.first}: " \
       "warning: \#{self.class}\##{old} is deprecated; #{msg}")
      end
      #{new}(*args, &block)
    end
  end;
end

.deprecated_attr_reader(*attrs) ⇒ Object

:nodoc:



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/rets4r/client/transaction.rb', line 45

def deprecated_attr_reader(*attrs) # :nodoc:
  attrs.each do |old|
    module_eval <<-"end;"
      def #{old}=(obj)
        if $VERBOSE
          warn("\#{caller.first}: " \
         "warning: \#{self.class}\##{old} is deprecated; \#{self.class}\##{old} is now set at initialization")
        end
        @#{old} = obj
      end
    end;
  end
end

Instance Method Details

#ascii_delimiterObject



26
27
28
# File 'lib/rets4r/client/transaction.rb', line 26

def ascii_delimiter
  self.delimiter.chr
end

#reply_codeObject



19
20
21
22
23
24
# File 'lib/rets4r/client/transaction.rb', line 19

def reply_code
  if $VERBOSE
    warn("#{caller.first}: warning: as of rets4r 2.0 #{self.class}#reply_code will be a numeric")
  end
  doc.reply_code.to_s
end