![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
The Poms gem provides an interface to the Dutch public broadcaster API: POMS. It reads from the Frontend API.
Add this line to your application's Gemfile:
gem 'poms'
And then execute:
$ bundle
Or install it yourself as:
$ gem install poms
The Poms API is only accessible to authenticated accounts. In order to make authenticated requests to the service, the module needs to be configured before making requests. This can be done in a Rails initializer for instance.
In order to configure the module:
Poms.configure do |config|
config.key = '**poms key**'
config.origin = '**poms origin**'
config.secret = '**poms secret**'
end
configure
can also read environment variables. ENV['POMS_KEY']
, ENV['POMS_ORIGIN']
, ENV['POMS_SECRET']
are used in this case.
The configure
function can also be provided with the base_url
in case you want to access the test environment for instance.
The Poms
module contains various ways to interact with the Poms service based on the API it exposes. The simplest way to get something is to use the first
of first!
function, which takes a MID (Media ID) used internally to identify all objects.
Poms.first('mid')
This returns a Hash of the json of the response provided by the Poms service. In this case this is a single object from Poms.
In order to do more advanced querying you might want to get the members or descendants of an object. members
simply returns all objects that are members of the object with the requested mid.
Poms.members('mid')
The result is a lazy enumerator (as the results are paginated on Poms) that contains all the members.
The descendants
function allows query parameters to be entered that are taken in account by the Poms service.
Poms.descendants('mid', {})
The result is similar to the members function, but each item contains metadata from the search query and the actual result is in the result
key of the item hash.
The poms
module contains a number of other functions that may be useful when you want to get some specific info from Poms. Also take a look at the examples in the examples
directory of this project.
The hashes that are returned from Poms can be nested to a high degree, making it harder to get some specific fields from them. The Poms::Fields
module provides helper functions to access things like title, descriptions and images.
Poms::Fields.title(poms_item)
This will return the title with the MAIN
type.
For reference of possible search options, see the POMS API wiki.
For Ruby we try to adhere to conventional naming and we map this to the relevant Poms API fields.
Gem | API |
---|---|
starts_at | "sortDates": { "begin" } |
ends_at | "sortDates": { "end" } |
type | { "facets": { "subsearch": { "types" } } } |
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Make sure to use Semantic Versioning when bumping the version. To release tag the master branch with the version and then push to rubygems. rake release
does this for you.
FAQs
Unknown package
We found that poms demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.