Sha256: c85bfb1995acae7068bd516dd5ec215d44a2720f0c4e81feb2933914e222f81a

Contents?: true

Size: 1.15 KB

Versions: 15

Compression:

Stored size: 1.15 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, card_id, total)
          set :autorecharge_enabled, true
          set :autorecharge_card_id, card_id
          set :autorecharge_total, total
          set :autorecharge_when_credit, when_credit
        end

        def disable_autorecharges
          set :autorecharge_enabled, false
        end

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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
portatext-1.3.1 lib/portatext/command/api/settings.rb
portatext-1.3.0 lib/portatext/command/api/settings.rb
portatext-1.2.0 lib/portatext/command/api/settings.rb
portatext-1.1.11 lib/portatext/command/api/settings.rb
portatext-1.1.10 lib/portatext/command/api/settings.rb
portatext-1.1.9 lib/portatext/command/api/settings.rb
portatext-1.1.8 lib/portatext/command/api/settings.rb
portatext-1.1.7 lib/portatext/command/api/settings.rb
portatext-1.1.6 lib/portatext/command/api/settings.rb
portatext-1.1.5 lib/portatext/command/api/settings.rb
portatext-1.1.4 lib/portatext/command/api/settings.rb
portatext-1.1.3 lib/portatext/command/api/settings.rb
portatext-1.1.2 lib/portatext/command/api/settings.rb
portatext-1.1.1 lib/portatext/command/api/settings.rb
portatext-1.1.0 lib/portatext/command/api/settings.rb