
Security News
Oxlint Introduces Type-Aware Linting Preview
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
A Rails library for the Mashery API.
Includes:
config/mashery.yml
config fileAdd the following to your Gemfile
gem "mashery_rails", require: "mashery"
Then run the installer to create config/mashery.yml
$ rails g mashery:install
Edit config/mashery.yml
with your site_key
, key
and secret
options.
---
site_id: '123'
key: "abc"
secret: "xyz"
host: "api.mashery.com"
Note this doesn't distinguish between development, testing, production, etc. If you really need that functionality, open a new issue.
The central data objects are all listed on the RPC API documentation page, and should be supported. However, fetching objects are the main & typically only supported method for each of these objects. If you would like more API methods, don't be shy! Create a pull request and it'll probably get merged within a day.
all
Fetch the first 100 objects of a particular type. The 100 objects constraint is caused by Mashery:
Query results are always paginated. There is a limit of fetching 100 records at one time. By default, only the first 100 records are returned.
Mashery::Member.all #=>
find_each
Much like ActiveRecord::Base.find_each
, this will take a block and auto-paginate the object set, working around the 100 items per page limitation stated above.
Mashery::Member.find_each {|m| m.do_something! }
first
Fetch the first object of a particular type. This is effectively setting "ITEMS 1" and reifying that object.
Mashery::Member.first #=>
count
The total number of objects.
Mashery::Member.count #=>
Mashery has a basic SQL-like Query Language. This library provides basic AREL-like functionality to build those queries. One small, but important difference is lack of lazy loading. These methods produce queries, but you have to call all
in order to retrieve the objects.
select
Change the SELECT fragment of the query.
Mashery::Member.select("name") #=>
where
Change the WHERE fragment of the query.
Mashery::Member.where(name: "User Name")
#=> SELECT * FROM members WHERE name = 'User Name' ITEMS 100
items
Change the ITEMS fragment of the query.
Mashery::Member.items(10)
#=> => SELECT * FROM members ITEMS 10
page
Change the PAGE fragment of the query.
Mashery::Member.page(10)
#=> SELECT * FROM members PAGE 10 ITEMS 100
Mashery's REST API are pulling statistics about Services. As such, these calls are invoked via the Service
API object
Service#activity
Maps to the CallsDeveloperActivityForService call.
service = Mashery::Service.where(key: "my_service_id")
service.activity #=>
Service#errorcodes
Maps to the CallsErrorcodesForService call.
service = Mashery::Service.where(key: "my_service_id")
service.errorcodes #=>
Service#errorcount
Maps to the CallsErrorcountByMethodForService call.
service = Mashery::Service.where(key: "my_service_id")
service.errorcount #=>
Service#latency
Maps to the CallsLatencyForService call.
service = Mashery::Service.where(key: "my_service_id")
service.latency #=>
Service#latency_by_method
Maps to the CallsLatencyByMethodForService call.
service = Mashery::Service.where(key: "my_service_id")
service.latency_by_method #=>
Service#methods
Maps to the CallsMethodsForService call.
service = Mashery::Service.where(key: "my_service_id")
service.methods #=>
Service#volume_by_hour
Maps to the CallsMedianVolumeByHourForService call.
service = Mashery::Service.where(key: "my_service_id")
service.volume_by_hour #=>
FAQs
Unknown package
We found that mashery_rails 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
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.