app/sms/bmc/sms.rb in bmc-1.0.1 vs app/sms/bmc/sms.rb in bmc-1.1.0
- old
+ new
@@ -1,35 +1,11 @@
module BMC::SMS
class << self
- def strategy=(value)
- @strategy = parse_strategy(value)
- end
+ attr_accessor :strategy
- def strategy
- @strategy ||= default_strategy
- end
-
attr_writer :default_from
def default_from
@default_from ||= Rails.application.class.to_s.chomp("::Application")
- end
-
- def parse_strategy(value)
- if value.is_a?(Symbol)
- "BMC::SMS::Strategies::#{value.to_s.camelcase}".constantize
- else
- value
- end
- end
-
- private
-
- def default_strategy
- if Rails.env.development? || Rails.env.test?
- BMC::SMS::Strategies::Test
- else
- BMC::SMS::Strategies::AmazonSNS
- end
end
end # class << self
end