class Patentscope::PctAppNumber

Public Class Methods

new(number = "") click to toggle source
Calls superclass method
# File lib/patentscope/pct_doc_number.rb, line 5
def initialize(number = "")
  raise NoNumberError,
    "Patent application number was not entered" if number.nil?
  super(number.strip)
end

Public Instance Methods

to_ia_number() click to toggle source
# File lib/patentscope/pct_doc_number.rb, line 20
def to_ia_number
  self.upcase!
  self.gsub!('/', '')
  self.gsub!('PCT', '')
  self
end
valid?() click to toggle source
# File lib/patentscope/pct_doc_number.rb, line 11
def valid?
  self.match(/\A(([Pp][Cc][Tt]\/?)?[a-zA-Z]{2}\d{4}\/?\d{6})\Z/)
end
validate() click to toggle source
# File lib/patentscope/pct_doc_number.rb, line 15
def validate
  raise WrongNumberFormatError,
    "PCT application number is not in correct format (PCT/CCYYYY/NNNNNN)" unless valid?
end