Class: HttpStore::Client
- Inherits:
-
Object
- Object
- HttpStore::Client
- Defined in:
- lib/http_store/client.rb
Constant Summary
Constants included from Helpers::Storable
Helpers::Storable::STRING_LIMIT_SIZE
Instance Attribute Summary collapse
-
#meta ⇒ Object
Returns the value of attribute meta.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args) ⇒ Client
constructor
A new instance of Client.
Methods included from Helpers::Storable
#gen_storable_meta, #load_storeable_record, #re_storable, #storable, #storable_meta, #storable_string, #store_request, #storeable_record
Methods included from Helpers::Responseable
#after_response, #build_response, #build_response_data, #json_response?, #response_valid?
Methods included from Helpers::Requestable
#format_request, #gen_request_digest, #get?, #json_request?, #post?, #request_digest_hash, #request_valid?, #set_request, #uri
Constructor Details
#initialize(args) ⇒ Client
Returns a new instance of Client.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/http_store/client.rb', line 13 def initialize(args) = Hashie::Mash.new(args) build_request return unless request_valid? # exist request or not force, return load_storeable_record and return if !force && storeable_record.present? execute # send request raise HttpStore::RequestError, 'response_obj is nil' if response_obj.nil? build_response after_response ensure store_request end |
Instance Attribute Details
#meta ⇒ Object
Returns the value of attribute meta.
3 4 5 |
# File 'lib/http_store/client.rb', line 3 def end |
Class Method Details
.execute(requestable, other_params = {}) ⇒ Object
9 10 11 |
# File 'lib/http_store/client.rb', line 9 def self.execute(requestable, other_params = {}) new(requestable: requestable, other_params: other_params) end |