Class: TitlePage::Stock

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

Overview

urn:TitleQueryStock

onHand - SOAP::SOAPString
onOrder - SOAP::SOAPString

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#onHandObject

Returns the value of attribute onHand.



117
118
119
# File 'lib/titlepage/titlepage_utils.rb', line 117

def onHand
  @onHand
end

#onOrderObject

Returns the value of attribute onOrder.



118
119
120
# File 'lib/titlepage/titlepage_utils.rb', line 118

def onOrder
  @onOrder
end