Class: KaveRestApi::Config
- Inherits:
-
RequestBase
- Object
- RequestBase
- KaveRestApi::Config
- Includes:
- Validatable
- Defined in:
- lib/kavenegar-ruby/requests/config.rb
Instance Attribute Summary collapse
-
#apilogs ⇒ Object
Returns the value of attribute apilogs.
-
#dailyreport ⇒ Object
Returns the value of attribute dailyreport.
-
#debugmode ⇒ Object
Returns the value of attribute debugmode.
-
#defaultsender ⇒ Object
Returns the value of attribute defaultsender.
-
#mincreditalarm ⇒ Object
Returns the value of attribute mincreditalarm.
-
#resendfailed ⇒ Object
Returns the value of attribute resendfailed.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #call ⇒ Object
- #full_message_errors ⇒ Object
-
#initialize(args = {}) ⇒ Config
constructor
A new instance of Config.
- #valid? ⇒ Boolean
Constructor Details
#initialize(args = {}) ⇒ Config
Returns a new instance of Config.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/kavenegar-ruby/requests/config.rb', line 8 def initialize(args = {}) @ACTION_NAME = [:config,@FORMAT].join('.').freeze @apilogs = args.fetch(:apilogs,nil) @dailyreport = args.fetch(:dailyreport,nil) @debugmode = args.fetch(:debugmode,nil) @defaultsender = args.fetch(:defaultsender,nil) @mincreditalarm = args.fetch(:mincreditalarm,nil) @resendfailed = args.fetch(:resendfailed,nil) @response = ResponseConfig.new end |
Instance Attribute Details
#apilogs ⇒ Object
Returns the value of attribute apilogs.
5 6 7 |
# File 'lib/kavenegar-ruby/requests/config.rb', line 5 def apilogs @apilogs end |
#dailyreport ⇒ Object
Returns the value of attribute dailyreport.
5 6 7 |
# File 'lib/kavenegar-ruby/requests/config.rb', line 5 def dailyreport @dailyreport end |
#debugmode ⇒ Object
Returns the value of attribute debugmode.
5 6 7 |
# File 'lib/kavenegar-ruby/requests/config.rb', line 5 def debugmode @debugmode end |
#defaultsender ⇒ Object
Returns the value of attribute defaultsender.
5 6 7 |
# File 'lib/kavenegar-ruby/requests/config.rb', line 5 def defaultsender @defaultsender end |
#mincreditalarm ⇒ Object
Returns the value of attribute mincreditalarm.
5 6 7 |
# File 'lib/kavenegar-ruby/requests/config.rb', line 5 def mincreditalarm @mincreditalarm end |
#resendfailed ⇒ Object
Returns the value of attribute resendfailed.
5 6 7 |
# File 'lib/kavenegar-ruby/requests/config.rb', line 5 def resendfailed @resendfailed end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/kavenegar-ruby/requests/config.rb', line 6 def response @response end |
Instance Method Details
#call ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/kavenegar-ruby/requests/config.rb', line 27 def call connection = Faraday.new(url: "#{@API_URL}/account/") do |faraday| faraday.adapter Faraday.default_adapter faraday.response @FORMAT.to_sym end response = connection.get(@ACTION_NAME,apilogs: @apilogs,dailyreport: @dailyreport,debugmode: @debugmode,defaultsender: @defaultsender,mincreditalarm: @mincreditalarm,resendfailed: @resendfailed) @response.validate(response.body) end |
#full_message_errors ⇒ Object
23 24 25 |
# File 'lib/kavenegar-ruby/requests/config.rb', line 23 def end |
#valid? ⇒ Boolean
19 20 21 |
# File 'lib/kavenegar-ruby/requests/config.rb', line 19 def valid? @valid end |