Class: TitlePage::Price

Inherits:
Object
  • Object
show all
Defined in:
lib/titlepage/titlepage_utils.rb

Overview

urn:TitleQueryPrice

priceTypeCode - SOAP::SOAPString
priceAmount - SOAP::SOAPDecimal

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(priceTypeCode = nil, priceAmount = nil) ⇒ Price

Returns a new instance of Price.



149
150
151
152
# File 'lib/titlepage/titlepage_utils.rb', line 149

def initialize(priceTypeCode = nil, priceAmount = nil)
  @priceTypeCode = priceTypeCode
  @priceAmount = priceAmount
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *arguments) ⇒ Object

An older version of soap4r that was used to generate boilerplate code in versions of this gem <= 0.9.3 created methods that started with capitals. Detect when some code calls these old method names and print a deprecation warning.



158
159
160
161
162
163
164
165
166
167
168
# File 'lib/titlepage/titlepage_utils.rb', line 158

def method_missing(method, *arguments)
  new_method = method.to_s[0,1].downcase
  new_method << method.to_s[1,20]

  if self.respond_to?(new_method)
    $stderr.puts "Warning: #{method} is deprecated. Use #{new_method} instead"
    self.send(new_method, *arguments)
  else
    super
  end
end

Instance Attribute Details

#priceAmountObject

Returns the value of attribute priceAmount.



147
148
149
# File 'lib/titlepage/titlepage_utils.rb', line 147

def priceAmount
  @priceAmount
end

#priceTypeCodeObject

Returns the value of attribute priceTypeCode.



146
147
148
# File 'lib/titlepage/titlepage_utils.rb', line 146

def priceTypeCode
  @priceTypeCode
end