Class: RedboothRuby::Request::Base
- Inherits:
-
Object
- Object
- RedboothRuby::Request::Base
- Defined in:
- lib/redbooth-ruby/request/base.rb
Instance Attribute Summary collapse
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(info) ⇒ Base
constructor
A new instance of Base.
- #perform ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(info) ⇒ Base
Returns a new instance of Base.
7 8 9 |
# File 'lib/redbooth-ruby/request/base.rb', line 7 def initialize(info) @info = info end |
Instance Attribute Details
#info ⇒ Object (readonly)
Returns the value of attribute info.
4 5 6 |
# File 'lib/redbooth-ruby/request/base.rb', line 4 def info @info end |
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/redbooth-ruby/request/base.rb', line 5 def response @response end |
Instance Method Details
#perform ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/redbooth-ruby/request/base.rb', line 11 def perform fail RedboothRuby::AuthenticationError unless valid? connection.set_request_data send_request validator.validated_response_for(response) end |
#valid? ⇒ Boolean
19 20 21 22 23 24 |
# File 'lib/redbooth-ruby/request/base.rb', line 19 def valid? return false unless info return false unless info.session return false unless info.session.valid? true end |