lib/phaxio.rb in phaxio-2.1.0.pre vs lib/phaxio.rb in phaxio-2.1.0

- old
+ new

@@ -15,11 +15,14 @@ Dir[File.expand_path(File.join('..', 'phaxio', 'helpers', '*.rb'), __FILE__)].each do |file| require file end -%w[fax_recipient fax account callback phax_code phone_number public ata].each do |filename| +%w[ + fax_recipient fax account callback webhook phax_code phone_number public ata + port_number_note port_number port_order +].each do |filename| require File.expand_path(File.join('..', 'phaxio', 'resources', filename), __FILE__) end module Phaxio include Resources @@ -27,15 +30,17 @@ class << self # @!attribute api_key # @see Config.api_key # @!attribute api_secret # @see Config.api_secret + # @!attribute webhook_token + # @see Config.webhook_token # @!attribute callback_token - # @see Config.callback_token + # @see Config.webhook_token # @!attribute api_endpoint # @see Config.api_endpoint - %w(api_key api_secret callback_token api_endpoint).each do |config_attribute| + %w(api_key api_secret webhook_token callback_token api_endpoint).each do |config_attribute| # Define getters define_method(config_attribute) do Config.public_send config_attribute end @@ -43,7 +48,11 @@ setter = "#{config_attribute}=" define_method(setter) do |value| Config.public_send setter, value end end + + # for backwards compatibility + alias callback_token webhook_token + alias callback_token= webhook_token= end end