Module: M2X::Client::Metadata
- Included in:
- Collection, Device, Distribution
- Defined in:
- lib/m2x/metadata.rb
Instance Method Summary collapse
- #metadata_path ⇒ Object
-
#read_metadata ⇒ Response
Method for Read Device Metadata, Read Distribution Metadata, Read Collection Metadata endpoints.
-
#read_metadata_field(field_name) ⇒ Response
Method for Read Device Metadata Field, Read Distribution Metadata Field, Read Collection Metadata Field endpoints.
-
#update_metadata(params) ⇒ Response
Method for Update Device Metadata, Update Distribution Metadata, Update Collection Metadata endpoints.
-
#update_metadata_field(field_name, value) ⇒ Response
Method for Update Device Metadata Field, Update Distribution Metadata Field, Update Collection Metadata Field endpoints.
Instance Method Details
#metadata_path ⇒ Object
54 55 56 |
# File 'lib/m2x/metadata.rb', line 54 def "#{path}/metadata" end |
#read_metadata ⇒ Response
Method for Read Device Metadata, Read Distribution Metadata, Read Collection Metadata endpoints.
10 11 12 |
# File 'lib/m2x/metadata.rb', line 10 def @client.get() end |
#read_metadata_field(field_name) ⇒ Response
Method for Read Device Metadata Field, Read Distribution Metadata Field, Read Collection Metadata Field endpoints.
23 24 25 |
# File 'lib/m2x/metadata.rb', line 23 def (field_name) @client.get("#{}/#{field_name}") end |
#update_metadata(params) ⇒ Response
Method for Update Device Metadata, Update Distribution Metadata, Update Collection Metadata endpoints.
36 37 38 |
# File 'lib/m2x/metadata.rb', line 36 def (params) @client.put(, nil, params, "Content-Type" => "application/json") end |
#update_metadata_field(field_name, value) ⇒ Response
Method for Update Device Metadata Field, Update Distribution Metadata Field, Update Collection Metadata Field endpoints.
50 51 52 |
# File 'lib/m2x/metadata.rb', line 50 def (field_name, value) @client.put("#{}/#{field_name}", nil, { value: value }, "Content-Type" => "application/json") end |