Sha256: a45d9673cfebe7e8e0d140bcba8c141580526ab406fc1a1f3ce599317992c7f4

Contents?: true

Size: 915 Bytes

Versions: 4

Compression:

Stored size: 915 Bytes

Contents

class SampleVerificationRequest < Witness::Base

  action :generate, :receive

  column :cas_host, :name => "CAS host"
  column :slice_slug, :name => "Slice"
  column :secure_area_id, :type => :integer, :name => "Secure Area ID"
  column :request_url, :name => "Request URL"
  column :receive_contact_url, :name => "Receive Contact URL"
  column :receive_login_url, :name => "Receive Login URL"

  validates_presence_of :slice_slug, :secure_area_id, :request_url, :receive_contact_url, :receive_login_url
  validates_presence_of :cas_host, :on => :generate

  def url
    Witness.update_url("http://#{cas_host}/cas/contact/witness", params)
  end

  def params
    {
      :slice_slug => slice_slug,
      :secure_area_id => secure_area_id,
      :request_url => request_url,
      :receive_contact_url => receive_contact_url,
      :receive_login_url => receive_login_url,
    }.reject { |k, v| v.nil? }
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
witness-2.1.2 spec/support/sample_verification_request.rb
witness-2.1.1 spec/support/sample_verification_request.rb
witness-2.1.0 spec/support/sample_verification_request.rb
witness-2.0.0 spec/support/sample_verification_request.rb