Class: Epo::Ops::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/epo/ops/address.rb

Overview

Used to represent persons or companies (or both) in patents. Used for both, agents and applicants. Most of the time, when ‘name` is a person name, `address1` is a company name. Be aware that the addresses are in their respective local format.

Current patents usually at least use the fields address1-3, so they should nearly always have values. Nevertheless, older ones often only use 1-2. Note also that EPOs schema documents fields like ‘street` or `city`, but by now they have not been used yet.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, address1, address2, address3, address4, address5, country_code, occurred_on, cdsid) ⇒ Address

Returns a new instance of Address.



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/epo/ops/address.rb', line 34

def initialize(name, address1, address2, address3, address4,
               address5, country_code, occurred_on,
               cdsid)
  @address1 = address1
  @address2 = address2
  @address3 = address3 || ''
  @address4 = address4 || ''
  @address5 = address5 || ''
  @name = name
  @country_code = country_code || ''
  @occurred_on = occurred_on || ''
  @cdsid = cdsid || ''
end

Instance Attribute Details

#address1String

first address line. May also be a company name

Returns:

  • (String)

    the current value of address1



25
26
27
# File 'lib/epo/ops/address.rb', line 25

def address1
  @address1
end

#address2String

second address line

Returns:

  • (String)

    the current value of address2



25
26
27
# File 'lib/epo/ops/address.rb', line 25

def address2
  @address2
end

#address3String

third address line, may be empty

Returns:

  • (String)

    the current value of address3



25
26
27
# File 'lib/epo/ops/address.rb', line 25

def address3
  @address3
end

#address4String

fourth address line, may be empty

Returns:

  • (String)

    the current value of address4



25
26
27
# File 'lib/epo/ops/address.rb', line 25

def address4
  @address4
end

#address5String

fifth address line, may be empty

Returns:

  • (String)

    the current value of address5



25
26
27
# File 'lib/epo/ops/address.rb', line 25

def address5
  @address5
end

#cdsidString

some kind of id the EPO provides, not sure yet if usable as reference.

Returns:

  • (String)

    the current value of cdsid



25
26
27
# File 'lib/epo/ops/address.rb', line 25

def cdsid
  @cdsid
end

#country_codeString

two letter country code of the address

Returns:

  • (String)

    the current value of country_code



25
26
27
# File 'lib/epo/ops/address.rb', line 25

def country_code
  @country_code
end

#nameString

the name of an entity (one or more persons or companies)

Returns:

  • (String)

    the current value of name



25
26
27
# File 'lib/epo/ops/address.rb', line 25

def name
  @name
end

#occurred_onDate

the date an address occurred on, usually matching the entries change_gazette_num

Returns:

  • (Date)

    the current value of occurred_on



25
26
27
# File 'lib/epo/ops/address.rb', line 25

def occurred_on
  @occurred_on
end

Instance Method Details

#equal_name_and_address?(other) ⇒ Boolean

Compare addresses by the name and address fields.

Returns:

  • (Boolean)


50
51
52
53
54
55
56
57
# File 'lib/epo/ops/address.rb', line 50

def equal_name_and_address?(other)
  name == other.name &&
    address1 == other.address1 &&
    address2 == other.address2 &&
    address3 == other.address3 &&
    address4 == other.address4 &&
    address5 == other.address5
end