Class: Hook0::Generated::EventsPerDayEntry
- Inherits:
-
Object
- Object
- Hook0::Generated::EventsPerDayEntry
- Defined in:
- lib/hook0/generated/models.rb
Overview
The EventsPerDayEntry the API declares.
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#application_id ⇒ Object
readonly
Returns the value of attribute application_id.
-
#application_name ⇒ Object
readonly
Returns the value of attribute application_name.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#is_provisional ⇒ Object
readonly
Returns the value of attribute is_provisional.
Class Method Summary collapse
-
.from_json(value) ⇒ EventsPerDayEntry
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(amount:, application_id:, application_name:, date:, is_provisional:) ⇒ EventsPerDayEntry
constructor
A new instance of EventsPerDayEntry.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(amount:, application_id:, application_name:, date:, is_provisional:) ⇒ EventsPerDayEntry
Returns a new instance of EventsPerDayEntry.
1140 1141 1142 1143 1144 1145 1146 1147 |
# File 'lib/hook0/generated/models.rb', line 1140 def initialize(amount:, application_id:, application_name:, date:, is_provisional:) @amount = amount @application_id = application_id @application_name = application_name @date = date @is_provisional = is_provisional freeze end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
1129 1130 1131 |
# File 'lib/hook0/generated/models.rb', line 1129 def amount @amount end |
#application_id ⇒ Object (readonly)
Returns the value of attribute application_id.
1129 1130 1131 |
# File 'lib/hook0/generated/models.rb', line 1129 def application_id @application_id end |
#application_name ⇒ Object (readonly)
Returns the value of attribute application_name.
1129 1130 1131 |
# File 'lib/hook0/generated/models.rb', line 1129 def application_name @application_name end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
1129 1130 1131 |
# File 'lib/hook0/generated/models.rb', line 1129 def date @date end |
#is_provisional ⇒ Object (readonly)
Returns the value of attribute is_provisional.
1129 1130 1131 |
# File 'lib/hook0/generated/models.rb', line 1129 def is_provisional @is_provisional end |
Class Method Details
.from_json(value) ⇒ EventsPerDayEntry
Read one out of what the API answered.
1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 |
# File 'lib/hook0/generated/models.rb', line 1153 def self.from_json(value) fields = Runtime.as_fields(value, "EventsPerDayEntry") new( amount: Runtime.read(fields, "amount", Runtime::INTEGER), application_id: Runtime.read(fields, "application_id", Runtime::UUID), application_name: Runtime.read(fields, "application_name", Runtime::TEXT), date: Runtime.read(fields, "date", Runtime::DATE), is_provisional: Runtime.read(fields, "is_provisional", Runtime::BOOLEAN) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
1181 1182 1183 |
# File 'lib/hook0/generated/models.rb', line 1181 def ==(other) other.is_a?(EventsPerDayEntry) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
1189 1190 1191 |
# File 'lib/hook0/generated/models.rb', line 1189 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
1167 1168 1169 1170 1171 1172 1173 1174 1175 |
# File 'lib/hook0/generated/models.rb', line 1167 def to_h out = {} out["amount"] = @amount out["application_id"] = @application_id out["application_name"] = @application_name out["date"] = Runtime.day(@date) out["is_provisional"] = @is_provisional out end |