Module: RedboothRuby::Operations::Meta
Instance Method Summary collapse
-
#metadata ⇒ Hash
Returns a hash with the object metadata.
-
#metadata=(hash) ⇒ Hash
Sets the given hash as the desired metadata.
-
#metadata_merge(hash) ⇒ Hash
Merges the given hash with the exiting metadata and set the result.
Instance Method Details
#metadata ⇒ Hash
Returns a hash with the object metadata
7 8 9 10 11 12 |
# File 'lib/redbooth-ruby/operations/meta.rb', line 7 def response = RedboothRuby.request(:get, nil, 'metadata', { target_id: id, target_type: klass_name }, { session: session }) response.data end |
#metadata=(hash) ⇒ Hash
Sets the given hash as the desired metadata
17 18 19 20 21 22 23 |
# File 'lib/redbooth-ruby/operations/meta.rb', line 17 def (hash) response = RedboothRuby.request(:post, nil, 'metadata', { target_id: id, target_type: klass_name, metadata: hash }, { session: session }) response.data end |
#metadata_merge(hash) ⇒ Hash
Merges the given hash with the exiting metadata and set the result
28 29 30 31 32 33 34 |
# File 'lib/redbooth-ruby/operations/meta.rb', line 28 def (hash) response = RedboothRuby.request(:put, nil, 'metadata', { target_id: id, target_type: klass_name, metadata: hash }, { session: session }) response.data end |