Class: Hook0::Generated::Application
- Inherits:
-
Object
- Object
- Hook0::Generated::Application
- Defined in:
- lib/hook0/generated/models.rb
Overview
The Application the API declares.
Instance Attribute Summary collapse
-
#application_id ⇒ Object
readonly
Returns the value of attribute application_id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#organization_id ⇒ Object
readonly
Returns the value of attribute organization_id.
Class Method Summary collapse
-
.from_json(value) ⇒ Application
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(application_id:, name:, organization_id:) ⇒ Application
constructor
A new instance of Application.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(application_id:, name:, organization_id:) ⇒ Application
Returns a new instance of Application.
269 270 271 272 273 274 |
# File 'lib/hook0/generated/models.rb', line 269 def initialize(application_id:, name:, organization_id:) @application_id = application_id @name = name @organization_id = organization_id freeze end |
Instance Attribute Details
#application_id ⇒ Object (readonly)
Returns the value of attribute application_id.
262 263 264 |
# File 'lib/hook0/generated/models.rb', line 262 def application_id @application_id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
262 263 264 |
# File 'lib/hook0/generated/models.rb', line 262 def name @name end |
#organization_id ⇒ Object (readonly)
Returns the value of attribute organization_id.
262 263 264 |
# File 'lib/hook0/generated/models.rb', line 262 def organization_id @organization_id end |
Class Method Details
.from_json(value) ⇒ Application
Read one out of what the API answered.
280 281 282 283 284 285 286 287 |
# File 'lib/hook0/generated/models.rb', line 280 def self.from_json(value) fields = Runtime.as_fields(value, "Application") new( application_id: Runtime.read(fields, "application_id", Runtime::UUID), name: Runtime.read(fields, "name", Runtime::TEXT), organization_id: Runtime.read(fields, "organization_id", Runtime::UUID) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
304 305 306 |
# File 'lib/hook0/generated/models.rb', line 304 def ==(other) other.is_a?(Application) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
312 313 314 |
# File 'lib/hook0/generated/models.rb', line 312 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
292 293 294 295 296 297 298 |
# File 'lib/hook0/generated/models.rb', line 292 def to_h out = {} out["application_id"] = @application_id out["name"] = @name out["organization_id"] = @organization_id out end |