Class: Hook0::Generated::ApplicationInfoConsumption

Inherits:
Object
  • Object
show all
Defined in:
lib/hook0/generated/models.rb

Overview

The ApplicationInfoConsumption the API declares.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(events_per_day: nil) ⇒ ApplicationInfoConsumption

Returns a new instance of ApplicationInfoConsumption.

Parameters:

  • events_per_day (Integer, nil) (defaults to: nil)

    carries events_per_day.



396
397
398
399
# File 'lib/hook0/generated/models.rb', line 396

def initialize(events_per_day: nil)
  @events_per_day = events_per_day
  freeze
end

Instance Attribute Details

#events_per_dayObject (readonly)

Returns the value of attribute events_per_day.



393
394
395
# File 'lib/hook0/generated/models.rb', line 393

def events_per_day
  @events_per_day
end

Class Method Details

.from_json(value) ⇒ ApplicationInfoConsumption

Read one out of what the API answered.

Parameters:

  • value (Object)

    the JSON document the API answered

Returns:



405
406
407
408
409
410
# File 'lib/hook0/generated/models.rb', line 405

def self.from_json(value)
  fields = Runtime.as_fields(value, "ApplicationInfoConsumption")
  new(
    events_per_day: Runtime.maybe(fields, "events_per_day", Runtime::INTEGER)
  )
end

Instance Method Details

#==(other) ⇒ Boolean Also known as: eql?

Whether that value carries the same members as this one.

Parameters:

  • other (Object)

Returns:

  • (Boolean)


425
426
427
# File 'lib/hook0/generated/models.rb', line 425

def ==(other)
  other.is_a?(ApplicationInfoConsumption) && to_h == other.to_h
end

#hashInteger

A value two equal instances share, so that either may key a hash.

Returns:

  • (Integer)


433
434
435
# File 'lib/hook0/generated/models.rb', line 433

def hash
  to_h.hash
end

#to_hHash{String => Object}

Write one back the way the API reads it.

Returns:

  • (Hash{String => Object})


415
416
417
418
419
# File 'lib/hook0/generated/models.rb', line 415

def to_h
  out = {}
  out["events_per_day"] = @events_per_day unless @events_per_day.nil?
  out
end