Class: Sap::VariantValue
- Inherits:
-
SapAnywhereInterface
- Object
- SapAnywhereInterface
- Sap::VariantValue
- Defined in:
- lib/resource/sap/variant_value.rb
Instance Method Summary collapse
-
#find(id, params = {}) ⇒ Object
通过接口获得单个数据.
-
#initialize(source) ⇒ VariantValue
constructor
对象初始化方法(初始化来源).
-
#list ⇒ Object
通过接口获得一堆数据.
- #query(id = {}, params = {}) ⇒ Object
-
#request_name ⇒ Object
获取请求路径的请求名.
Methods inherited from SapAnywhereInterface
#check_access_token, #check_function_and_shop, #convert_payment_type, #convert_price_unit, #delete, #get, #get_access_token, #get_access_token_url, #handle_response, #patch, #post
Constructor Details
#initialize(source) ⇒ VariantValue
Note:
对象初始化方法(初始化来源)
对象初始化方法(初始化来源)
11 12 13 |
# File 'lib/resource/sap/variant_value.rb', line 11 def initialize(source) @source = source end |
Instance Method Details
#find(id, params = {}) ⇒ Object
Note:
通过接口获得单个数据
通过接口获得单个数据
28 29 30 |
# File 'lib/resource/sap/variant_value.rb', line 28 def find(id, params = {}) get(query(id, params)) end |
#list ⇒ Object
Note:
通过接口获得一堆数据
通过接口获得一堆数据
21 22 23 |
# File 'lib/resource/sap/variant_value.rb', line 21 def list get(query) end |
#query(id = {}, params = {}) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/resource/sap/variant_value.rb', line 39 def query(id = {}, params = {}) request_names = if id.present? "#{request_name}/#{id}?expand=*&" # end else "#{request_name}?" end { source: @source, request_name: request_names } end |
#request_name ⇒ Object
Note:
获取请求路径的请求名
获取请求路径的请求名
34 35 36 |
# File 'lib/resource/sap/variant_value.rb', line 34 def request_name 'Products/VariantValues' end |