Module: KaveRestApi

Defined in:
lib/kavenegar-ruby.rb,
lib/kavenegar-ruby/core.rb,
lib/kavenegar-ruby/helper.rb,
lib/kavenegar-ruby/meaning.rb,
lib/kavenegar-ruby/request.rb,
lib/kavenegar-ruby/respond.rb,
lib/kavenegar-ruby/version.rb,
lib/kavenegar-ruby/requests/tts.rb,
lib/kavenegar-ruby/responds/tts.rb,
lib/kavenegar-ruby/requests/info.rb,
lib/kavenegar-ruby/requests/send.rb,
lib/kavenegar-ruby/responds/info.rb,
lib/kavenegar-ruby/responds/send.rb,
lib/kavenegar-ruby/requests/cancel.rb,
lib/kavenegar-ruby/requests/config.rb,
lib/kavenegar-ruby/requests/lookup.rb,
lib/kavenegar-ruby/responds/cancel.rb,
lib/kavenegar-ruby/responds/config.rb,
lib/kavenegar-ruby/responds/lookup.rb,
lib/kavenegar-ruby/requests/deliver.rb,
lib/kavenegar-ruby/requests/receive.rb,
lib/kavenegar-ruby/responds/deliver.rb,
lib/kavenegar-ruby/responds/receive.rb,
lib/kavenegar-ruby/helpers/convertor.rb,
lib/kavenegar-ruby/helpers/validator.rb,
lib/kavenegar-ruby/requests/countinbox.rb,
lib/kavenegar-ruby/responds/countinbox.rb,
lib/kavenegar-ruby/requests/RequestBase.rb,
lib/kavenegar-ruby/requests/latestoutbox.rb,
lib/kavenegar-ruby/requests/selectoutbox.rb,
lib/kavenegar-ruby/responds/latestoutbox.rb,
lib/kavenegar-ruby/responds/selectoutbox.rb,
lib/kavenegar-ruby/requests/countpostalcode.rb,
lib/kavenegar-ruby/responds/countpostalcode.rb,
lib/generators/kavenegar-ruby/install_generator.rb

Defined Under Namespace

Modules: Generators, NumberHelper, StringHelper Classes: Cancel, Config, Configuration, CountInBox, CountPostalCode, Deliver, Info, LatestOutBox, Lookup, Receive, RequestBase, ResponseCancel, ResponseConfig, ResponseCountInBox, ResponseCountPostalCode, ResponseDeliver, ResponseInfo, ResponseLatestOutBox, ResponseLookup, ResponseReceive, ResponseSelectOutBox, ResponseSendSimple, ResponseTts, SelectOutBox, SendSimple, Tts

Constant Summary collapse

ERRORS =
{
  '200' => I18n.t("KaveRestApi.200", :default => "Request Approved"),
  '400' => I18n.t("KaveRestApi.400", :default => "Argument Error"),
  '401' => I18n.t("KaveRestApi.401", :default => "Account has been disabled"),
  '402' => I18n.t("KaveRestApi.402", :default => "Operation failed"),
  '403' => I18n.t("KaveRestApi.403", :default => "Not a valid API key"),
  '404' => I18n.t("KaveRestApi.404", :default => "Undeifined method"),
  '405' => I18n.t("KaveRestApi.405", :default => "Get / Post wrong"),
  '406' => I18n.t("KaveRestApi.406", :default => "Eequired field"),
  '407' => I18n.t("KaveRestApi.407", :default => "You don't currently have permission to access this method"),
  '408' => I18n.t("KaveRestApi.408", :default => "fallback text"),
  '409' => I18n.t("KaveRestApi.409", :default => "Server not able to respond"),
  '411' => I18n.t("KaveRestApi.411", :default => "Not a valid receptor"),
  '412' => I18n.t("KaveRestApi.412", :default => "Not a valid sender"),
  '413' => I18n.t("KaveRestApi.413", :default => "Message is invalid"),
  '414' => I18n.t("KaveRestApi.414", :default => "Request is limit"),
  '415' => I18n.t("KaveRestApi.415", :default => "fallback text"),
  '417' => I18n.t("KaveRestApi.417", :default => "Not a valid UnixTime"),
  '418' => I18n.t("KaveRestApi.418", :default => "Your credit is not enough"),
  '419' => I18n.t("KaveRestApi.419", :default => "fallback text"),
  '422' => I18n.t("KaveRestApi.422", :default => "fallback text"),
  '424' => I18n.t("KaveRestApi.424", :default => "Template not found"),
  '426' => I18n.t("KaveRestApi.426", :default => "fallback text"),
  '428' => I18n.t("KaveRestApi.428", :default => "fallback text"),
  '431' => I18n.t("KaveRestApi.431", :default => "fallback text"),
}
ENTRIES =
{
  :inـqueue => '1',
  :givenـdate => '2',
  :deliver_to_telecommunications => '4',
  :failed => '6',
  :delivered => '10',
  :inaccessible => '11',
  :ads_block => '14',
  :sms_id_is_invalid => '100'
}
VERSION =
"1.0.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



14
15
16
# File 'lib/kavenegar-ruby.rb', line 14

def configuration
  @configuration
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:



17
18
19
20
# File 'lib/kavenegar-ruby.rb', line 17

def self.configure
  self.configuration ||= Configuration.new
  yield configuration
end

.require_libs(lib_path, *libs) ⇒ Object



5
6
7
8
9
# File 'lib/kavenegar-ruby/core.rb', line 5

def self.require_libs(lib_path,*libs)
  libs.each do |lib|
    require_relative "#{lib_path}/#{lib}"
  end
end