Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

little_sms

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

little_sms

  • 0.2.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

LittleSMS

This gem provides access to LittleSMS.ru API from ruby (mri 1.8.7 and 1.9.2 supported).

Installation

$ gem install little_sms

Usage

require "little_sms"
api = LittleSMS.new(:apiuser, :apikey)
api.message.send(:recipients => "+79211234567", :message => "Test", :test => 1)

Also you can pass a block to LittleSMS object:

LittleSMS.new(:apiuser, :apikey) do
  msg =  message.send(:recipients => "+79211234567", :message => "Test")
  if msg.success?
    messages_id = msg.messages_id.join
    status = message.status(:messages_id => messages_id)
    puts "Message #{status.messages[messages_id]}" unless status.error? # => Message delivered
  end
end

In case of error:

LittleSMS.new(:apiuser, :apikey) do
  msg = message.send(:recipients => "112", :message => "Test")
  if msg.error?
    puts msg.error   # => 4
    puts msg.message # => "incorrect or empty recipients list"
  end
end

Copyright © 2011 Artyom Bolshakov. See LICENSE.txt for details.

FAQs

Package last updated on 06 Jul 2011

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc