Module: CellForce::DefaultShortCode

Included in:
MobileDevice, TcpaOptInCampaign
Defined in:
lib/cell_force/default_short_code.rb

Instance Method Summary collapse

Instance Method Details

#short_code_idObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/cell_force/default_short_code.rb', line 5

def short_code_id
  @short_code_id ||= begin
    data = Api.post("shortcode/getusershortcodes").data
    if short_code
      data.find{ |e| short_code.to_s == e["shortcode"].to_s }
    else
      # If the instance was not initialized with a short_code, we use the first one we find
      data[0].tap { |s| @short_code = s["shortcode"] }
    end["shortcode_id"]
  end
end