Class: CorreiosSigep::Models::Collect

Inherits:
Object
  • Object
show all
Defined in:
lib/correios_sigep/models/collect.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Collect

Returns a new instance of Collect.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/correios_sigep/models/collect.rb', line 14

def initialize(options = {})
  @aditional_service  = options[:aditional_service]
  @ag                 = options[:ag]
  @ar                 = options[:ar]
  @card               = options[:card]
  @checklist          = options[:checklist]
  @client_id          = options[:client_id]
  @declared_value     = options[:declared_value]
  @description        = options[:description]
  @number             = options[:number]
  @type               = options[:type]

  @product = options[:product] || Product.new(options.fetch(:product_params, {}))
  @sender  = options[:sender] || Sender.new(options.fetch(:sender_params, {}))
  @objects = options.fetch(:objects, [])
end

Instance Attribute Details

#aditional_serviceObject

Returns the value of attribute aditional_service.



4
5
6
# File 'lib/correios_sigep/models/collect.rb', line 4

def aditional_service
  @aditional_service
end

#agObject

Returns the value of attribute ag.



4
5
6
# File 'lib/correios_sigep/models/collect.rb', line 4

def ag
  @ag
end

#arObject

Returns the value of attribute ar.



4
5
6
# File 'lib/correios_sigep/models/collect.rb', line 4

def ar
  @ar
end

#cardObject

Returns the value of attribute card.



4
5
6
# File 'lib/correios_sigep/models/collect.rb', line 4

def card
  @card
end

#checklistObject

Returns the value of attribute checklist.



4
5
6
# File 'lib/correios_sigep/models/collect.rb', line 4

def checklist
  @checklist
end

#client_idObject

Returns the value of attribute client_id.



4
5
6
# File 'lib/correios_sigep/models/collect.rb', line 4

def client_id
  @client_id
end

#declared_valueObject

Returns the value of attribute declared_value.



4
5
6
# File 'lib/correios_sigep/models/collect.rb', line 4

def declared_value
  @declared_value
end

#descriptionObject

Returns the value of attribute description.



4
5
6
# File 'lib/correios_sigep/models/collect.rb', line 4

def description
  @description
end

#numberObject

Returns the value of attribute number.



4
5
6
# File 'lib/correios_sigep/models/collect.rb', line 4

def number
  @number
end

#objectsObject

Returns the value of attribute objects.



4
5
6
# File 'lib/correios_sigep/models/collect.rb', line 4

def objects
  @objects
end

#productObject

Returns the value of attribute product.



4
5
6
# File 'lib/correios_sigep/models/collect.rb', line 4

def product
  @product
end

#product_paramsObject

Returns the value of attribute product_params.



4
5
6
# File 'lib/correios_sigep/models/collect.rb', line 4

def product_params
  @product_params
end

#senderObject

Returns the value of attribute sender.



4
5
6
# File 'lib/correios_sigep/models/collect.rb', line 4

def sender
  @sender
end

#sender_paramsObject

Returns the value of attribute sender_params.



4
5
6
# File 'lib/correios_sigep/models/collect.rb', line 4

def sender_params
  @sender_params
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/correios_sigep/models/collect.rb', line 4

def type
  @type
end

Class Method Details

.build(&block) ⇒ Object



8
9
10
11
12
# File 'lib/correios_sigep/models/collect.rb', line 8

def self.build(&block)
  builder = Builders::Collect.new
  builder.instance_eval(&block)
  builder.build
end