Class: Beanie::ProductionOrder
- Defined in:
- lib/beanie/bill_of_material.rb,
lib/beanie/production_order.rb
Instance Attribute Summary collapse
-
#bill_of_material_id ⇒ Object
Returns the value of attribute bill_of_material_id.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#number ⇒ Object
Returns the value of attribute number.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
-
#revision ⇒ Object
Returns the value of attribute revision.
-
#sales_order_id ⇒ Object
Returns the value of attribute sales_order_id.
-
#state ⇒ Object
Returns the value of attribute state.
-
#stock_item_id ⇒ Object
Returns the value of attribute stock_item_id.
-
#work_centre_group_id ⇒ Object
Returns the value of attribute work_centre_group_id.
Instance Method Summary collapse
-
#construct_path(opts = {}) ⇒ Object
Construct the path a little differently…
-
#initialize ⇒ ProductionOrder
constructor
Initialize instance variables.
-
#private_data ⇒ Object
Get the private data.
-
#private_data=(data) ⇒ Object
Update/set the private data.
Methods inherited from Api
all, build_url, delete, #extract, #field_name, find, get, #object_name, #populate, post, put, #save!, set_headers
Constructor Details
#initialize ⇒ ProductionOrder
Initialize instance variables
36 37 38 39 40 41 42 |
# File 'lib/beanie/bill_of_material.rb', line 36 def initialize @id = nil @name = nil @revision = nil @description = nil @stock_item_id = nil end |
Instance Attribute Details
#bill_of_material_id ⇒ Object
Returns the value of attribute bill_of_material_id.
33 34 35 |
# File 'lib/beanie/production_order.rb', line 33 def bill_of_material_id @bill_of_material_id end |
#description ⇒ Object
Returns the value of attribute description.
32 33 34 |
# File 'lib/beanie/bill_of_material.rb', line 32 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
32 33 34 |
# File 'lib/beanie/bill_of_material.rb', line 32 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
32 33 34 |
# File 'lib/beanie/bill_of_material.rb', line 32 def name @name end |
#notes ⇒ Object
Returns the value of attribute notes.
32 33 34 |
# File 'lib/beanie/production_order.rb', line 32 def notes @notes end |
#number ⇒ Object
Returns the value of attribute number.
32 33 34 |
# File 'lib/beanie/production_order.rb', line 32 def number @number end |
#quantity ⇒ Object
Returns the value of attribute quantity.
32 33 34 |
# File 'lib/beanie/production_order.rb', line 32 def quantity @quantity end |
#revision ⇒ Object
Returns the value of attribute revision.
32 33 34 |
# File 'lib/beanie/bill_of_material.rb', line 32 def revision @revision end |
#sales_order_id ⇒ Object
Returns the value of attribute sales_order_id.
33 34 35 |
# File 'lib/beanie/production_order.rb', line 33 def sales_order_id @sales_order_id end |
#state ⇒ Object
Returns the value of attribute state.
32 33 34 |
# File 'lib/beanie/production_order.rb', line 32 def state @state end |
#stock_item_id ⇒ Object
Returns the value of attribute stock_item_id.
32 33 34 |
# File 'lib/beanie/bill_of_material.rb', line 32 def stock_item_id @stock_item_id end |
#work_centre_group_id ⇒ Object
Returns the value of attribute work_centre_group_id.
33 34 35 |
# File 'lib/beanie/production_order.rb', line 33 def work_centre_group_id @work_centre_group_id end |
Instance Method Details
#construct_path(opts = {}) ⇒ Object
Construct the path a little differently…
69 70 71 72 73 74 |
# File 'lib/beanie/production_order.rb', line 69 def construct_path(opts = {}) raise ":work_centre_group_id is not defined" unless opts[:work_centre_group_id] path = "/work_centre_groups/#{opts[:work_centre_group_id]}/production_orders" opts.delete(:work_centre_group_id) path end |
#private_data ⇒ Object
Get the private data
51 52 53 54 55 56 57 |
# File 'lib/beanie/production_order.rb', line 51 def private_data unless @_private_data response = ProductionOrder.get(:url => "/production_orders/#{@id}/private_data") @_private_data = response["data"] end return @_private_data end |
#private_data=(data) ⇒ Object
Update/set the private data
61 62 63 64 65 |
# File 'lib/beanie/production_order.rb', line 61 def private_data=(data) @_private_data = data pdata = {:data => data} ProductionOrder.post(pdata, :url => "/production_orders/#{@id}/private_data") end |