class Shokkenki::Consumer::Model::Ticket
Attributes
consumer[R]
interactions[R]
provider[R]
time[RW]
version[RW]
Public Class Methods
new(attributes)
click to toggle source
# File lib/shokkenki/consumer/model/ticket.rb, line 12 def initialize attributes @provider = attributes[:provider] @consumer = attributes[:consumer] @interactions = attributes[:interactions] @version = Shokkenki::Consumer::Version::STRING end
Public Instance Methods
filename()
click to toggle source
# File lib/shokkenki/consumer/model/ticket.rb, line 19 def filename "#{@consumer.name}-#{@provider.name}.json" end
to_hash()
click to toggle source
# File lib/shokkenki/consumer/model/ticket.rb, line 23 def to_hash { :consumer => @consumer.to_hash, :provider => @provider.to_hash, :interactions => @interactions.collect(&:to_hash), :version => @version } end
to_json()
click to toggle source
# File lib/shokkenki/consumer/model/ticket.rb, line 32 def to_json JSON.pretty_generate to_hash end