Class: TitlePage::Stock
- Inherits:
-
Object
- Object
- TitlePage::Stock
- Defined in:
- lib/titlepage/titlepage_utils.rb
Overview
urn:TitleQueryStock
onHand - SOAP::SOAPString
onOrder - SOAP::SOAPString
Instance Attribute Summary collapse
-
#onHand ⇒ Object
Returns the value of attribute onHand.
-
#onOrder ⇒ Object
Returns the value of attribute onOrder.
Instance Method Summary collapse
-
#initialize(onHand = nil, onOrder = nil) ⇒ Stock
constructor
A new instance of Stock.
-
#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.
Constructor Details
#initialize(onHand = nil, onOrder = nil) ⇒ Stock
Returns a new instance of Stock.
120 121 122 123 |
# File 'lib/titlepage/titlepage_utils.rb', line 120 def initialize(onHand = nil, onOrder = nil) @onHand = onHand @onOrder = onOrder 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.
129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/titlepage/titlepage_utils.rb', line 129 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
#onHand ⇒ Object
Returns the value of attribute onHand.
117 118 119 |
# File 'lib/titlepage/titlepage_utils.rb', line 117 def onHand @onHand end |
#onOrder ⇒ Object
Returns the value of attribute onOrder.
118 119 120 |
# File 'lib/titlepage/titlepage_utils.rb', line 118 def onOrder @onOrder end |