Class: HookSniff::Models::Endpoint
- Inherits:
-
Object
- Object
- HookSniff::Models::Endpoint
- Defined in:
- lib/hooksniff/models.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#is_active ⇒ Object
readonly
Returns the value of attribute is_active.
-
#retry_policy ⇒ Object
readonly
Returns the value of attribute retry_policy.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(data) ⇒ Endpoint
constructor
A new instance of Endpoint.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ Endpoint
Returns a new instance of Endpoint.
8 9 10 11 12 13 14 15 |
# File 'lib/hooksniff/models.rb', line 8 def initialize(data) @id = data["id"] @url = data["url"] @description = data["description"] @is_active = data["is_active"] @retry_policy = data["retry_policy"] ? RetryPolicy.new(data["retry_policy"]) : nil @created_at = data["created_at"] end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
6 7 8 |
# File 'lib/hooksniff/models.rb', line 6 def created_at @created_at end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/hooksniff/models.rb', line 6 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/hooksniff/models.rb', line 6 def id @id end |
#is_active ⇒ Object (readonly)
Returns the value of attribute is_active.
6 7 8 |
# File 'lib/hooksniff/models.rb', line 6 def is_active @is_active end |
#retry_policy ⇒ Object (readonly)
Returns the value of attribute retry_policy.
6 7 8 |
# File 'lib/hooksniff/models.rb', line 6 def retry_policy @retry_policy end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/hooksniff/models.rb', line 6 def url @url end |
Instance Method Details
#to_h ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/hooksniff/models.rb', line 17 def to_h { id: @id, url: @url, description: @description, is_active: @is_active, retry_policy: @retry_policy&.to_h, created_at: @created_at } end |