Module: Digicert::Findable
- Included in:
- Certificate, Domain, Order
- Defined in:
- lib/digicert/findable.rb
Instance Method Summary collapse
-
#find(resource_id) ⇒ Object
The ‘.find` interface is just an alternvatie to instantiate a new object, and please remeber this does not perform any actual API Request.
-
#find_by_object(object) ⇒ Object
Find by object.
Instance Method Details
#find(resource_id) ⇒ Object
The ‘.find` interface is just an alternvatie to instantiate a new object, and please remeber this does not perform any actual API Request. Use this interface whenever you need to instantite an object from an existing id and then perform some operation throught the objec’s instnace methods, like ‘#active`, `#reissue` and etc
If you need an actual API response then use the ‘.fetch` API, that will perform an actual API Reqeust and will return the response from the Digicer API.
We are not going to implement this right away, but in long run may be we cna add some sort to lazy evaluation on this interface, but that’s not for sure.
18 19 20 |
# File 'lib/digicert/findable.rb', line 18 def find(resource_id) new(resource_id: resource_id) end |
#find_by_object(object) ⇒ Object
Find by object
This ‘find_by_object` interface works more likely a wrapper around `find` interface, it expects the `object` to response to the `id` method. Then it delegates object initialization behavior to the `find` interface.
29 30 31 |
# File 'lib/digicert/findable.rb', line 29 def find_by_object(object) find(object.id) end |