Class: MercadoPublicoCl::POVendor
- Inherits:
-
Data
- Object
- Data
- MercadoPublicoCl::POVendor
- Defined in:
- lib/mercado_publico_cl/value_objects/purchase_order_vendor.rb
Instance Attribute Summary collapse
-
#activity ⇒ Object
readonly
Returns the value of attribute activity.
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#branch_code ⇒ Object
readonly
Returns the value of attribute branch_code.
-
#branch_name ⇒ Object
readonly
Returns the value of attribute branch_name.
-
#branch_rut ⇒ Object
readonly
Returns the value of attribute branch_rut.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#comuna ⇒ Object
readonly
Returns the value of attribute comuna.
-
#contact ⇒ Object
readonly
Returns the value of attribute contact.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
Class Method Summary collapse
Instance Method Summary collapse
- #inspect ⇒ Object (also: #to_s)
Instance Attribute Details
#activity ⇒ Object (readonly)
Returns the value of attribute activity
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_vendor.rb', line 4 def activity @activity end |
#address ⇒ Object (readonly)
Returns the value of attribute address
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_vendor.rb', line 4 def address @address end |
#branch_code ⇒ Object (readonly)
Returns the value of attribute branch_code
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_vendor.rb', line 4 def branch_code @branch_code end |
#branch_name ⇒ Object (readonly)
Returns the value of attribute branch_name
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_vendor.rb', line 4 def branch_name @branch_name end |
#branch_rut ⇒ Object (readonly)
Returns the value of attribute branch_rut
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_vendor.rb', line 4 def branch_rut @branch_rut end |
#code ⇒ Object (readonly)
Returns the value of attribute code
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_vendor.rb', line 4 def code @code end |
#comuna ⇒ Object (readonly)
Returns the value of attribute comuna
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_vendor.rb', line 4 def comuna @comuna end |
#contact ⇒ Object (readonly)
Returns the value of attribute contact
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_vendor.rb', line 4 def contact @contact end |
#country ⇒ Object (readonly)
Returns the value of attribute country
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_vendor.rb', line 4 def country @country end |
#name ⇒ Object (readonly)
Returns the value of attribute name
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_vendor.rb', line 4 def name @name end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_vendor.rb', line 4 def raw @raw end |
#region ⇒ Object (readonly)
Returns the value of attribute region
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_vendor.rb', line 4 def region @region end |
Class Method Details
.from_payload(raw) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_vendor.rb', line 18 def self.from_payload(raw) return nil if raw.nil? || raw.empty? new( code: Resources::Base.to_int(raw["Codigo"] || raw["CodigoProveedor"]), name: raw["Nombre"] || raw["NombreProveedor"], activity: raw["Actividad"], country: raw["Pais"], branch_code: raw["CodigoSucursal"], branch_name: raw["NombreSucursal"], branch_rut: raw["RutSucursal"], address: raw["Direccion"], comuna: raw["Comuna"], region: raw["Region"], contact: Contact.from_payload(raw), raw: raw ) end |
Instance Method Details
#inspect ⇒ Object Also known as: to_s
37 38 39 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_vendor.rb', line 37 def inspect "#<POVendor code=#{code.inspect} name=#{name.inspect} branch=#{branch_name.inspect}>" end |