Class: Hook0::Generated::ApplicationSecret
- Inherits:
-
Object
- Object
- Hook0::Generated::ApplicationSecret
- Defined in:
- lib/hook0/generated/models.rb
Overview
The ApplicationSecret the API declares.
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#deleted_at ⇒ Object
readonly
Returns the value of attribute deleted_at.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Class Method Summary collapse
-
.from_json(value) ⇒ ApplicationSecret
Read one out of what the API answered.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
(also: #eql?)
Whether that value carries the same members as this one.
-
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
-
#initialize(created_at:, token:, deleted_at: nil, name: nil) ⇒ ApplicationSecret
constructor
A new instance of ApplicationSecret.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(created_at:, token:, deleted_at: nil, name: nil) ⇒ ApplicationSecret
Returns a new instance of ApplicationSecret.
615 616 617 618 619 620 621 |
# File 'lib/hook0/generated/models.rb', line 615 def initialize(created_at:, token:, deleted_at: nil, name: nil) @created_at = created_at @token = token @deleted_at = deleted_at @name = name freeze end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
606 607 608 |
# File 'lib/hook0/generated/models.rb', line 606 def created_at @created_at end |
#deleted_at ⇒ Object (readonly)
Returns the value of attribute deleted_at.
606 607 608 |
# File 'lib/hook0/generated/models.rb', line 606 def deleted_at @deleted_at end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
606 607 608 |
# File 'lib/hook0/generated/models.rb', line 606 def name @name end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
606 607 608 |
# File 'lib/hook0/generated/models.rb', line 606 def token @token end |
Class Method Details
.from_json(value) ⇒ ApplicationSecret
Read one out of what the API answered.
627 628 629 630 631 632 633 634 635 |
# File 'lib/hook0/generated/models.rb', line 627 def self.from_json(value) fields = Runtime.as_fields(value, "ApplicationSecret") new( created_at: Runtime.read(fields, "created_at", Runtime::DATE_TIME), token: Runtime.read(fields, "token", Runtime::UUID), deleted_at: Runtime.maybe(fields, "deleted_at", Runtime::DATE_TIME), name: Runtime.maybe(fields, "name", Runtime::TEXT) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
653 654 655 |
# File 'lib/hook0/generated/models.rb', line 653 def ==(other) other.is_a?(ApplicationSecret) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
661 662 663 |
# File 'lib/hook0/generated/models.rb', line 661 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
640 641 642 643 644 645 646 647 |
# File 'lib/hook0/generated/models.rb', line 640 def to_h out = {} out["created_at"] = Runtime.moment(@created_at) out["token"] = @token out["deleted_at"] = Runtime.moment(@deleted_at) unless @deleted_at.nil? out["name"] = @name unless @name.nil? out end |