Class: WebmaniabrNfeRuby::Models::Request
- Inherits:
-
Object
- Object
- WebmaniabrNfeRuby::Models::Request
- Defined in:
- lib/models/request.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#emission ⇒ Object
Returns the value of attribute emission.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#goal ⇒ Object
Returns the value of attribute goal.
-
#id ⇒ Object
Returns the value of attribute id.
-
#model ⇒ Object
Returns the value of attribute model.
-
#operation ⇒ Object
Returns the value of attribute operation.
-
#operation_nature ⇒ Object
Returns the value of attribute operation_nature.
-
#order ⇒ Object
Returns the value of attribute order.
-
#products ⇒ Object
Returns the value of attribute products.
-
#transport ⇒ Object
Returns the value of attribute transport.
-
#url_notification ⇒ Object
Returns the value of attribute url_notification.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Request
constructor
A new instance of Request.
- #to_hash ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Request
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/models/request.rb', line 8 def initialize( = {}) @id = [:id] @url_notification = [:url_notification] @operation = [:operation] @operation_nature = [:operation_nature] @model = [:model] @emission = [:emission] @goal = [:goal] @environment = [:environment] @client = [:client] @products = [:products] @order = [:order] @transport = [:transport] end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/models/request.rb', line 4 def client @client end |
#emission ⇒ Object
Returns the value of attribute emission.
4 5 6 |
# File 'lib/models/request.rb', line 4 def emission @emission end |
#environment ⇒ Object
Returns the value of attribute environment.
4 5 6 |
# File 'lib/models/request.rb', line 4 def environment @environment end |
#goal ⇒ Object
Returns the value of attribute goal.
4 5 6 |
# File 'lib/models/request.rb', line 4 def goal @goal end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/models/request.rb', line 4 def id @id end |
#model ⇒ Object
Returns the value of attribute model.
4 5 6 |
# File 'lib/models/request.rb', line 4 def model @model end |
#operation ⇒ Object
Returns the value of attribute operation.
4 5 6 |
# File 'lib/models/request.rb', line 4 def operation @operation end |
#operation_nature ⇒ Object
Returns the value of attribute operation_nature.
4 5 6 |
# File 'lib/models/request.rb', line 4 def operation_nature @operation_nature end |
#order ⇒ Object
Returns the value of attribute order.
4 5 6 |
# File 'lib/models/request.rb', line 4 def order @order end |
#products ⇒ Object
Returns the value of attribute products.
4 5 6 |
# File 'lib/models/request.rb', line 4 def products @products end |
#transport ⇒ Object
Returns the value of attribute transport.
4 5 6 |
# File 'lib/models/request.rb', line 4 def transport @transport end |
#url_notification ⇒ Object
Returns the value of attribute url_notification.
4 5 6 |
# File 'lib/models/request.rb', line 4 def url_notification @url_notification end |
Instance Method Details
#to_hash ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/models/request.rb', line 23 def to_hash products = [] if @products.class == Array @products.each do |product| products.push product.to_hash end end if @transport transport = @transport.to_hash else transport = '' end { ID: @id, url_notificacao: @url_notification, operacao: @operation, natureza_operacao: @operation_nature, modelo: @model, emissao: @emission, finalidade: @goal, ambiente: @environment, cliente: @client.to_hash, produtos: products, pedido: @order.to_hash, transporte: transport } end |