Class: Ellington::Ticket

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/ellington/ticket.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(goal = nil, hash = {}) ⇒ Ticket

Returns a new instance of Ticket.



9
10
11
12
13
# File 'lib/ellington/ticket.rb', line 9

def initialize(goal=nil, hash={})
  goal ||= Ellington::Target.new
  @goal = goal
  super hash
end

Instance Attribute Details

#goalObject (readonly)

Returns the value of attribute goal.



7
8
9
# File 'lib/ellington/ticket.rb', line 7

def goal
  @goal
end

#passengerObject (readonly)

Returns the value of attribute passenger.



7
8
9
# File 'lib/ellington/ticket.rb', line 7

def passenger
  @passenger
end

Instance Method Details

#idObject



15
16
17
# File 'lib/ellington/ticket.rb', line 15

def id
  Digest::SHA256.hexdigest values.map(&:to_s).join
end