Class: Evesync::IPC::Data::Package
- Inherits:
-
Object
- Object
- Evesync::IPC::Data::Package
- Extended by:
- Unhashable
- Includes:
- Hashable
- Defined in:
- lib/evesync/ipc/data/package.rb
Defined Under Namespace
Modules: Command
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #==(pkg) ⇒ Object
-
#initialize(params) ⇒ Package
constructor
A new instance of Package.
- #to_s ⇒ Object
Methods included from Unhashable
Methods included from Hashable
Constructor Details
#initialize(params) ⇒ Package
Returns a new instance of Package.
20 21 22 23 24 25 |
# File 'lib/evesync/ipc/data/package.rb', line 20 def initialize(params) @name = params[:name].freeze @version = params[:version].freeze @command = parse_command(params[:command]).freeze @timestamp = params[:timestamp] || NTP. end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
18 19 20 |
# File 'lib/evesync/ipc/data/package.rb', line 18 def command @command end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
18 19 20 |
# File 'lib/evesync/ipc/data/package.rb', line 18 def name @name end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
18 19 20 |
# File 'lib/evesync/ipc/data/package.rb', line 18 def @timestamp end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
18 19 20 |
# File 'lib/evesync/ipc/data/package.rb', line 18 def version @version end |
Instance Method Details
#==(pkg) ⇒ Object
27 28 29 30 31 |
# File 'lib/evesync/ipc/data/package.rb', line 27 def ==(pkg) (pkg.name == @name) && (pkg.version == @version) && (pkg.command == @command) end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/evesync/ipc/data/package.rb', line 33 def to_s "Package(#{@command.upcase}: #{name}-#{@version})" end |