Class: Hook0::Generated::InstanceConfigMatomo
- Inherits:
-
Object
- Object
- Hook0::Generated::InstanceConfigMatomo
- Defined in:
- lib/hook0/generated/models.rb
Overview
The InstanceConfigMatomo the API declares.
Instance Attribute Summary collapse
-
#site_id ⇒ Object
readonly
Returns the value of attribute site_id.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
-
.from_json(value) ⇒ InstanceConfigMatomo
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(site_id:, url:) ⇒ InstanceConfigMatomo
constructor
A new instance of InstanceConfigMatomo.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(site_id:, url:) ⇒ InstanceConfigMatomo
Returns a new instance of InstanceConfigMatomo.
1413 1414 1415 1416 1417 |
# File 'lib/hook0/generated/models.rb', line 1413 def initialize(site_id:, url:) @site_id = site_id @url = url freeze end |
Instance Attribute Details
#site_id ⇒ Object (readonly)
Returns the value of attribute site_id.
1408 1409 1410 |
# File 'lib/hook0/generated/models.rb', line 1408 def site_id @site_id end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
1408 1409 1410 |
# File 'lib/hook0/generated/models.rb', line 1408 def url @url end |
Class Method Details
.from_json(value) ⇒ InstanceConfigMatomo
Read one out of what the API answered.
1423 1424 1425 1426 1427 1428 1429 |
# File 'lib/hook0/generated/models.rb', line 1423 def self.from_json(value) fields = Runtime.as_fields(value, "InstanceConfigMatomo") new( site_id: Runtime.read(fields, "site_id", Runtime::INTEGER), url: Runtime.read(fields, "url", Runtime::TEXT) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
1445 1446 1447 |
# File 'lib/hook0/generated/models.rb', line 1445 def ==(other) other.is_a?(InstanceConfigMatomo) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
1453 1454 1455 |
# File 'lib/hook0/generated/models.rb', line 1453 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
1434 1435 1436 1437 1438 1439 |
# File 'lib/hook0/generated/models.rb', line 1434 def to_h out = {} out["site_id"] = @site_id out["url"] = @url out end |