lib/castronaut/models/ticket_granting_ticket.rb in masover-castronaut-0.4.4.5 vs lib/castronaut/models/ticket_granting_ticket.rb in masover-castronaut-0.5.0.1

- old
+ new

@@ -25,12 +25,12 @@ end Castronaut::TicketResult.new(ticket_granting_ticket) end - def self.generate_for(identifier, client_host) - create! :identifier => identifier, :client_hostname => client_host + def self.generate_for(result, client_host) + create! :identifier => result.identifier, :client_hostname => client_host, :extra_info => result.extra_info end def ticket_prefix "TGC" end @@ -42,9 +42,27 @@ ticket end def expired? false + end + + + # Serialized + def extra_info + value = self[:extra_info] + value.nil? ? nil : YAML.load(value) + end + def extra_info= value + self[:extra_info] = value.nil? ? nil : value.to_yaml + end + + def extra_xml + if self.extra_info.blank? + nil + else + self.extra_info.to_xml :skip_instruct => true, :root => 'extra_info' + end end end end