Sha256: 67fc03d87fa41701bc2d20561a8d34cde2a0dbbace4e11aebf169915ee745e7f

Contents?: true

Size: 972 Bytes

Versions: 2

Compression:

Stored size: 972 Bytes

Contents

module CTM
  class Source < Base
    attr_reader :id, :account_id
    attr_accessor :name, :referring_url, :landing_url, :position, :online, :crm_tag

    def initialize(data, token=nil)
      super(data, token)
      @id            = data['id']
      @account_id    = data['account_id']
      @name          = data['name']
      @referring_url = data['referring_url']
      @landing_url   = data['landing_url']
      @position      = data['position']
      @online        = data['online']
      @crm_tag       = data['crm_tag']
    end

    def save
      options = {
        :name          => @name,
        :position      => @position,
        :online        => @online,
        :referring_url => @referring_url,
        :landing_url   => @landing_url,
        :crm_tag       => @crm_tag
      }
      super(options)
    end

    def numbers(options={})
      CTM::NumberList.new(options.merge(:account_id => @account_id, :source_id => @id), @token)
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ctm-0.5.4 lib/ctm/source.rb
ctm-0.5.3 lib/ctm/source.rb