Module: UU::Finman::Contract
- Extended by:
- Contract
- Included in:
- Contract
- Defined in:
- lib/uu/finman/contract.rb,
lib/uu/finman/contract/contract_attributes.rb,
lib/uu/finman/contract/contract_set_attributes.rb
Overview
Module of Contract
Defined Under Namespace
Classes: ContractAttributes, ContractSetAttributes
Constant Summary
- PATH =
Service path
'uu/finman/contract/Contract'
Instance Method Summary (collapse)
-
- (UU::Finman::Contract::ContractAttributes) get_attributes(contract_uri)
Obtains Contract attributes from REST service and returns them.
-
- (Object) set_attributes(contract_uri, contract_set_attributes)
# Unset Contract attributes.
Instance Method Details
- (UU::Finman::Contract::ContractAttributes) get_attributes(contract_uri)
Obtains Contract attributes from REST service and returns them
31 32 33 34 35 36 37 38 |
# File 'lib/uu/finman/contract.rb', line 31 def get_attributes(contract_uri) svc = UU::OS::REST::RemoteClient.new(Contract) UU::OS::QoS::QoSHandler.auto_retry do attrs_string = svc.get('getAttributes', contract_uri) attrs = JSON.parse(attrs_string, :symbolize_names => true) return UU::Finman::Contract::ContractAttributes.new(attrs) end end |
- (Object) set_attributes(contract_uri, contract_set_attributes)
# Unset Contract attributes.
UU::Finman::Contract.set_attributes(contract_uri,
:name => "",
:credit_account_uri => UU::OS::UESURI.new('ues:[-1]:[-1]'),
:amount_without_vat => "",
:control_side => "");
62 63 64 65 66 67 68 69 70 71 |
# File 'lib/uu/finman/contract.rb', line 62 def set_attributes(contract_uri, contract_set_attributes) svc = UU::OS::REST::RemoteClient.new(Contract) a_attrs = UU::Finman::Contract::ContractSetAttributes.new(contract_set_attributes) transaction = transform_contract_to_dto(a_attrs).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', contract_uri, transaction) return UU::OS::UESURI.new(res) end end |