Class: NexusMods::Api::ModUpdates

Inherits:
Resource
  • Object
show all
Defined in:
lib/nexus_mods/api/mod_updates.rb

Overview

A NexusMods mod updates.

Instance Method Summary collapse

Constructor Details

#initialize(nexus_mods:, game_domain_name:, mod_id:, latest_file_update:, latest_mod_activity:) ⇒ ModUpdates

Constructor

Parameters
  • nexus_mods (NexusMods): The NexusMods API instance that the resource can use to query for other resources

  • game_domain_name (String): The game this file belongs to

  • mod_id (Integer): The mod’s id

  • latest_file_update (Time): The mod’s latest file update

  • latest_mod_activity (Time): The mod’s latest activity



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/nexus_mods/api/mod_updates.rb', line 27

def initialize(
  nexus_mods:,
  game_domain_name:,
  mod_id:,
  latest_file_update:,
  latest_mod_activity:
)
  super(nexus_mods:)
  @game_domain_name = game_domain_name
  @mod_id = mod_id
  @latest_file_update = latest_file_update
  @latest_mod_activity = latest_mod_activity
end

Instance Method Details

#==(other) ⇒ Object

Equality operator

Parameters
  • other (Object): Other object to compare with

Result
  • Boolean: Are objects equal?



47
48
49
50
51
52
53
# File 'lib/nexus_mods/api/mod_updates.rb', line 47

def ==(other)
  other.is_a?(ModUpdates) &&
    @game_domain_name == game_domain_name &&
    @mod_id == other.mod_id &&
    @latest_file_update == other.latest_file_update &&
    @latest_mod_activity == other.latest_mod_activity
end

#modObject

Get associated mod information

Result
  • Mod: The corresponding mod



59
60
61
# File 'lib/nexus_mods/api/mod_updates.rb', line 59

def mod
  @nexus_mods.mod(game_domain_name:, mod_id:)
end

#mod_filesObject

Get associated mod files information

Result
  • Array<ModFile>: The corresponding mod files



67
68
69
# File 'lib/nexus_mods/api/mod_updates.rb', line 67

def mod_files
  @nexus_mods.mod_files(game_domain_name:, mod_id:)
end