Class: EpoOps::NameAndAddress
- Inherits:
-
Object
- Object
- EpoOps::NameAndAddress
- Defined in:
- lib/epo_ops/name_and_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
-
#address1 ⇒ String
first address line.
-
#address2 ⇒ String
second address line.
-
#address3 ⇒ String
third address line, may be empty.
-
#address4 ⇒ String
fourth address line, may be empty.
-
#address5 ⇒ String
fifth address line, may be empty.
-
#cdsid ⇒ String
some kind of id the EPO provides, not sure yet if.
-
#country_code ⇒ String
two letter country code of the address.
-
#name ⇒ String
the name of an entity (one or more persons or companies).
-
#occurred_on ⇒ Date
the date an address occurred on, usually matching the entries change_gazette_num usable as reference.
Instance Method Summary collapse
-
#equal_name_and_address?(other) ⇒ Boolean
Compare addresses by the name and address fields.
-
#initialize(name, address1, address2, address3, address4, address5, country_code, cdsid, occurred_on = nil) ⇒ NameAndAddress
constructor
A new instance of NameAndAddress.
Constructor Details
#initialize(name, address1, address2, address3, address4, address5, country_code, cdsid, occurred_on = nil) ⇒ NameAndAddress
Returns a new instance of NameAndAddress.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/epo_ops/name_and_address.rb', line 34 def initialize(name, address1, address2, address3, address4, address5, country_code, cdsid, occurred_on= nil) @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
#address1 ⇒ String
first address line. May also be a company name
24 25 26 |
# File 'lib/epo_ops/name_and_address.rb', line 24 def address1 @address1 end |
#address2 ⇒ String
second address line
24 25 26 |
# File 'lib/epo_ops/name_and_address.rb', line 24 def address2 @address2 end |
#address3 ⇒ String
third address line, may be empty
24 25 26 |
# File 'lib/epo_ops/name_and_address.rb', line 24 def address3 @address3 end |
#address4 ⇒ String
fourth address line, may be empty
24 25 26 |
# File 'lib/epo_ops/name_and_address.rb', line 24 def address4 @address4 end |
#address5 ⇒ String
fifth address line, may be empty
24 25 26 |
# File 'lib/epo_ops/name_and_address.rb', line 24 def address5 @address5 end |
#cdsid ⇒ String
some kind of id the EPO provides, not sure yet if
24 25 26 |
# File 'lib/epo_ops/name_and_address.rb', line 24 def cdsid @cdsid end |
#country_code ⇒ String
two letter country code of the address
24 25 26 |
# File 'lib/epo_ops/name_and_address.rb', line 24 def country_code @country_code end |
#name ⇒ String
the name of an entity (one or more persons or companies)
24 25 26 |
# File 'lib/epo_ops/name_and_address.rb', line 24 def name @name end |
#occurred_on ⇒ Date
the date an address occurred on, usually matching the entries change_gazette_num usable as reference.
24 25 26 |
# File 'lib/epo_ops/name_and_address.rb', line 24 def occurred_on @occurred_on end |
Instance Method Details
#equal_name_and_address?(other) ⇒ Boolean
Compare addresses by the name and address fields.
49 50 51 52 53 54 55 56 |
# File 'lib/epo_ops/name_and_address.rb', line 49 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 |