Class: CorreiosSigep::Models::Product

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Product



12
13
14
15
16
# File 'lib/correios_sigep/models/product.rb', line 12

def initialize(options={})
  @code     = options[:code]
  @type     = options[:type]
  @quantity = options[:quantity]
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



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

def code
  @code
end

#quantityObject

Returns the value of attribute quantity.



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

def quantity
  @quantity
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

Class Method Details

.build(&block) ⇒ Object



6
7
8
9
10
# File 'lib/correios_sigep/models/product.rb', line 6

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