Class: MercadoPublicoCl::TenderBuyer

Inherits:
Data
  • Object
show all
Defined in:
lib/mercado_publico_cl/value_objects/tender_buyer.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code

Returns:

  • (Object)

    the current value of code



4
5
6
# File 'lib/mercado_publico_cl/value_objects/tender_buyer.rb', line 4

def code
  @code
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



4
5
6
# File 'lib/mercado_publico_cl/value_objects/tender_buyer.rb', line 4

def name
  @name
end

#rawObject (readonly)

Returns the value of attribute raw

Returns:

  • (Object)

    the current value of raw



4
5
6
# File 'lib/mercado_publico_cl/value_objects/tender_buyer.rb', line 4

def raw
  @raw
end

#unit_addressObject (readonly)

Returns the value of attribute unit_address

Returns:

  • (Object)

    the current value of unit_address



4
5
6
# File 'lib/mercado_publico_cl/value_objects/tender_buyer.rb', line 4

def unit_address
  @unit_address
end

#unit_codeObject (readonly)

Returns the value of attribute unit_code

Returns:

  • (Object)

    the current value of unit_code



4
5
6
# File 'lib/mercado_publico_cl/value_objects/tender_buyer.rb', line 4

def unit_code
  @unit_code
end

#unit_comunaObject (readonly)

Returns the value of attribute unit_comuna

Returns:

  • (Object)

    the current value of unit_comuna



4
5
6
# File 'lib/mercado_publico_cl/value_objects/tender_buyer.rb', line 4

def unit_comuna
  @unit_comuna
end

#unit_nameObject (readonly)

Returns the value of attribute unit_name

Returns:

  • (Object)

    the current value of unit_name



4
5
6
# File 'lib/mercado_publico_cl/value_objects/tender_buyer.rb', line 4

def unit_name
  @unit_name
end

#unit_regionObject (readonly)

Returns the value of attribute unit_region

Returns:

  • (Object)

    the current value of unit_region



4
5
6
# File 'lib/mercado_publico_cl/value_objects/tender_buyer.rb', line 4

def unit_region
  @unit_region
end

#unit_rutObject (readonly)

Returns the value of attribute unit_rut

Returns:

  • (Object)

    the current value of unit_rut



4
5
6
# File 'lib/mercado_publico_cl/value_objects/tender_buyer.rb', line 4

def unit_rut
  @unit_rut
end

#user_codeObject (readonly)

Returns the value of attribute user_code

Returns:

  • (Object)

    the current value of user_code



4
5
6
# File 'lib/mercado_publico_cl/value_objects/tender_buyer.rb', line 4

def user_code
  @user_code
end

#user_nameObject (readonly)

Returns the value of attribute user_name

Returns:

  • (Object)

    the current value of user_name



4
5
6
# File 'lib/mercado_publico_cl/value_objects/tender_buyer.rb', line 4

def user_name
  @user_name
end

#user_roleObject (readonly)

Returns the value of attribute user_role

Returns:

  • (Object)

    the current value of user_role



4
5
6
# File 'lib/mercado_publico_cl/value_objects/tender_buyer.rb', line 4

def user_role
  @user_role
end

#user_rutObject (readonly)

Returns the value of attribute user_rut

Returns:

  • (Object)

    the current value of user_rut



4
5
6
# File 'lib/mercado_publico_cl/value_objects/tender_buyer.rb', line 4

def user_rut
  @user_rut
end

Class Method Details

.from_payload(raw) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/mercado_publico_cl/value_objects/tender_buyer.rb', line 19

def self.from_payload(raw)
  return nil if raw.nil? || raw.empty?

  new(
    code: Resources::Base.to_int(raw["CodigoOrganismo"]),
    name: raw["NombreOrganismo"],
    unit_code: raw["CodigoUnidad"],
    unit_name: raw["NombreUnidad"],
    unit_rut: raw["RutUnidad"],
    unit_address: raw["DireccionUnidad"],
    unit_comuna: raw["ComunaUnidad"],
    unit_region: raw["RegionUnidad"],
    user_code: raw["CodigoUsuario"],
    user_rut: raw["RutUsuario"],
    user_name: raw["NombreUsuario"],
    user_role: raw["CargoUsuario"],
    raw: raw
  )
end

Instance Method Details

#inspectObject Also known as: to_s



39
40
41
# File 'lib/mercado_publico_cl/value_objects/tender_buyer.rb', line 39

def inspect
  "#<TenderBuyer code=#{code.inspect} name=#{name.inspect} user=#{user_name.inspect}>"
end