Class: Lapis::Minecraft::Versioning::Basic
- Inherits:
-
Object
- Object
- Lapis::Minecraft::Versioning::Basic
- Defined in:
- lib/lapis/minecraft/versioning/basic.rb
Overview
Minimal information about a Minecraft version.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ String
readonly
Unique identifier used to reference the version.
-
#time ⇒ Time
readonly
Date and time the version was made available to the public.
-
#type ⇒ Symbol
readonly
Type of version.
-
#url ⇒ String
readonly
URL pointing to detailed information about the version.
Instance Method Summary collapse
-
#==(other) ⇒ true, false
Compares one version to another.
-
#initialize(id, type, time, url) ⇒ Basic
constructor
Creates the basic information for a Minecraft version.
Constructor Details
#initialize(id, type, time, url) ⇒ Basic
Creates the basic information for a Minecraft version.
34 35 36 37 38 39 |
# File 'lib/lapis/minecraft/versioning/basic.rb', line 34 def initialize(id, type, time, url) @id = id.dup.freeze @type = type @time = time @url = url.dup.freeze end |
Instance Attribute Details
#id ⇒ String (readonly)
Unique identifier used to reference the version.
10 11 12 |
# File 'lib/lapis/minecraft/versioning/basic.rb', line 10 def id @id end |
#time ⇒ Time (readonly)
Date and time the version was made available to the public.
23 24 25 |
# File 'lib/lapis/minecraft/versioning/basic.rb', line 23 def time @time end |
#type ⇒ Symbol (readonly)
Type of version. This can be one of:
-
:release
- Official release. -
:snapshot
- Unstable, in development. -
:beta
- Old beta. -
:alpha
- Old alpha.
19 20 21 |
# File 'lib/lapis/minecraft/versioning/basic.rb', line 19 def type @type end |
#url ⇒ String (readonly)
URL pointing to detailed information about the version.
27 28 29 |
# File 'lib/lapis/minecraft/versioning/basic.rb', line 27 def url @url end |
Instance Method Details
#==(other) ⇒ true, false
Compares one version to another.
45 46 47 48 49 50 |
# File 'lib/lapis/minecraft/versioning/basic.rb', line 45 def ==(other) other.id == @id && other.type == @type && other.time == @time && other.url == @url end |