Class: CASino::ProxyResponseBuilder
- Inherits:
-
Object
- Object
- CASino::ProxyResponseBuilder
- Defined in:
- app/builders/casino/proxy_response_builder.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#success ⇒ Object
readonly
Returns the value of attribute success.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(success, options) ⇒ ProxyResponseBuilder
constructor
A new instance of ProxyResponseBuilder.
Constructor Details
#initialize(success, options) ⇒ ProxyResponseBuilder
Returns a new instance of ProxyResponseBuilder.
6 7 8 9 |
# File 'app/builders/casino/proxy_response_builder.rb', line 6 def initialize(success, ) @success = success @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'app/builders/casino/proxy_response_builder.rb', line 4 def @options end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
4 5 6 |
# File 'app/builders/casino/proxy_response_builder.rb', line 4 def success @success end |
Instance Method Details
#build ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/builders/casino/proxy_response_builder.rb', line 11 def build xml = Builder::XmlMarkup.new(indent: 2) xml.cas :serviceResponse, 'xmlns:cas' => 'http://www.yale.edu/tp/cas' do |service_response| if success service_response.cas :proxySuccess do |proxy_success| proxy_success.cas :proxyTicket, [:proxy_ticket].ticket end else service_response.cas :proxyFailure, [:error_message], code: [:error_code] end end xml.target! end |