Sha256: 7e0fe78f1002cccd1edbaf881a466f710d392fa6d7b00c231f28630cebe4f51a

Contents?: true

Size: 587 Bytes

Versions: 2

Compression:

Stored size: 587 Bytes

Contents

module RTurk
  Notification = Struct.new(:Destination, :Transport, :Version, :EventType) do
    extend RTurk::Utilities

    members.each do |member|
      underscore = underscore(member)
      alias_method underscore, member
      alias_method "#{underscore}=", "#{member}="
    end

    def to_param_hash
      self.version = RTurk::OLD_API_VERSION # enforce this blindly

      hash = {}
      missing = []
      each_pair do |k, v|
        raise MissingParameters, "Missing parameter for #{k}" if v.nil?
        hash["Notification.1.#{k}"] = v
      end
      hash
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rturk-2.1.0 lib/rturk/builders/notification_builder.rb
rturk-2.0.5 lib/rturk/builders/notification_builder.rb