Class: GdsApi::ContentStore
Defined Under Namespace
Classes: ItemNotFound
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #content_item(base_path) ⇒ Object
- #content_item!(base_path) ⇒ Object
- #incoming_links!(base_path, params = {}) ⇒ Object
Methods inherited from Base
#client, #create_client, #get_list!, #initialize, #url_for_slug
Constructor Details
This class inherits a constructor from GdsApi::Base
Instance Method Details
#content_item(base_path) ⇒ Object
12 13 14 |
# File 'lib/gds_api/content_store.rb', line 12 def content_item(base_path) get_json(content_item_url(base_path)) end |
#content_item!(base_path) ⇒ Object
23 24 25 26 27 |
# File 'lib/gds_api/content_store.rb', line 23 def content_item!(base_path) get_json!(content_item_url(base_path)) rescue GdsApi::HTTPNotFound => e raise ItemNotFound.build_from(e) end |
#incoming_links!(base_path, params = {}) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/gds_api/content_store.rb', line 16 def incoming_links!(base_path, params = {}) query = query_string(params) get_json!("#{endpoint}/incoming-links#{base_path}#{query}") rescue GdsApi::HTTPNotFound => e raise ItemNotFound.build_from(e) end |