Sha256: 6c8834223e72a2030c914ea3afd4d45972a4048d38f0e88f0e65be84a6ae798c

Contents?: true

Size: 1.19 KB

Versions: 4

Compression:

Stored size: 1.19 KB

Contents

module PortaText
  module Command
    module Api
      # The me/settings endpoint.
      # https://github.com/PortaText/docs/wiki/REST-API#api_settings
      #
      # Author::    Marcelo Gornstein (mailto:marcelog@portatext.com)
      # Copyright:: Copyright (c) 2015 PortaText
      # License::   Apache-2.0
      class Settings < Base
        def dont_alert_on_low_credit
          set :alert_when_credit_less_than, nil
        end

        def alert_when_credit_less_than(total)
          set :alert_when_credit_less_than, total
        end

        def dont_send_inbound_by_email
          set :email_on_inbound_sms, nil
        end

        def send_inbound_by_email(email)
          set :email_on_inbound_sms, email
        end

        def enable_autorecharges(when_credit, total)
          set :autorecharge_enabled, true
          set :autorecharge_total, total
          set :autorecharge_when_credit, when_credit
        end

        def disable_autorecharges
          set :autorecharge_enabled, false
        end

        def default_credit_card(card_id)
          set :default_card_id, card_id
        end

        def endpoint(_method)
          'me/settings'
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
portatext-1.4.3 lib/portatext/command/api/settings.rb
portatext-1.4.2 lib/portatext/command/api/settings.rb
portatext-1.4.1 lib/portatext/command/api/settings.rb
portatext-1.4.0 lib/portatext/command/api/settings.rb