Class: Agris::Api::Grain::NewContract
- Inherits:
-
Object
- Object
- Agris::Api::Grain::NewContract
- Includes:
- XmlModel
- Defined in:
- lib/agris/api/grain/new_contract.rb
Constant Summary collapse
- ATTRIBUTE_NAMES =
%w( purchase_sales contract_location contract_number contract_type commodity varietyclass status quantity_base weight_base grade_base signed date_written contract_name_id ship_to_from_id misc_id agent_broker_id external_contract_no delivery_terms transport_mode dp_table invoice_terms scheduled_quantity contract_loads advance_percent quantity_uom add_update_option ).freeze
Instance Attribute Summary collapse
-
#record_type ⇒ Object
readonly
Returns the value of attribute record_type.
Instance Method Summary collapse
- #add_remark(remark) ⇒ Object
- #add_schedule(schedule) ⇒ Object
-
#initialize(hash = {}) ⇒ NewContract
constructor
A new instance of NewContract.
- #records ⇒ Object
- #remarks ⇒ Object
- #schedules ⇒ Object
- #xml_ignore_attributes ⇒ Object
Methods included from XmlModel
Constructor Details
#initialize(hash = {}) ⇒ NewContract
Returns a new instance of NewContract.
41 42 43 44 45 |
# File 'lib/agris/api/grain/new_contract.rb', line 41 def initialize(hash = {}) super @record_type = 'GRNC0' end |
Instance Attribute Details
#record_type ⇒ Object (readonly)
Returns the value of attribute record_type.
38 39 40 |
# File 'lib/agris/api/grain/new_contract.rb', line 38 def record_type @record_type end |
Instance Method Details
#add_remark(remark) ⇒ Object
54 55 56 57 58 59 |
# File 'lib/agris/api/grain/new_contract.rb', line 54 def add_remark(remark) @remarks ||= [] @remarks << remark self end |
#add_schedule(schedule) ⇒ Object
47 48 49 50 51 52 |
# File 'lib/agris/api/grain/new_contract.rb', line 47 def add_schedule(schedule) @schedules ||= [] @schedules << schedule self end |
#records ⇒ Object
69 70 71 |
# File 'lib/agris/api/grain/new_contract.rb', line 69 def records [self] + schedules + remarks end |
#remarks ⇒ Object
65 66 67 |
# File 'lib/agris/api/grain/new_contract.rb', line 65 def remarks @remarks || [] end |
#schedules ⇒ Object
61 62 63 |
# File 'lib/agris/api/grain/new_contract.rb', line 61 def schedules @schedules || [] end |
#xml_ignore_attributes ⇒ Object
73 74 75 |
# File 'lib/agris/api/grain/new_contract.rb', line 73 def xml_ignore_attributes %i(schedules remarks) end |