Class: Typekitable::RequestFetcher
- Inherits:
-
Object
- Object
- Typekitable::RequestFetcher
- Defined in:
- lib/typekitable/request_fetcher.rb
Constant Summary collapse
- VALID_TYPES =
[:kit_list, :kit_add, :kit_info, :kit_publish]
- VALID_OPTIONS =
{ :kit_add => [:name, :domains] }
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#resource_id ⇒ Object
readonly
Returns the value of attribute resource_id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, options = {}, resource_id = nil) ⇒ RequestFetcher
constructor
A new instance of RequestFetcher.
- #parameters ⇒ Object
- #request_path ⇒ Object
- #response ⇒ Object
- #verb ⇒ Object
Constructor Details
#initialize(type, options = {}, resource_id = nil) ⇒ RequestFetcher
Returns a new instance of RequestFetcher.
10 11 12 13 14 |
# File 'lib/typekitable/request_fetcher.rb', line 10 def initialize(type, = {}, resource_id = nil) @type = validate_type(type) = () @resource_id = resource_id end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/typekitable/request_fetcher.rb', line 3 def end |
#resource_id ⇒ Object (readonly)
Returns the value of attribute resource_id.
3 4 5 |
# File 'lib/typekitable/request_fetcher.rb', line 3 def resource_id @resource_id end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/typekitable/request_fetcher.rb', line 3 def type @type end |
Instance Method Details
#parameters ⇒ Object
24 25 26 |
# File 'lib/typekitable/request_fetcher.rb', line 24 def parameters end |
#request_path ⇒ Object
16 17 18 |
# File 'lib/typekitable/request_fetcher.rb', line 16 def request_path request_config[type][:request_path] end |
#response ⇒ Object
28 29 30 |
# File 'lib/typekitable/request_fetcher.rb', line 28 def response Request.new(request_path, verb, parameters).response end |
#verb ⇒ Object
20 21 22 |
# File 'lib/typekitable/request_fetcher.rb', line 20 def verb request_config[type][:verb] end |