Sha256: 45dc02a44b23e541fb4a03f91eeddaf6aef5ba03f9ee096db6d3e09bcd2a084c

Contents?: true

Size: 492 Bytes

Versions: 1

Compression:

Stored size: 492 Bytes

Contents

module ZeroCaptcha
  # Model of a Captcha returned by ZeroCaptcha API.
  #
  class Captcha < ZeroCaptcha::Model
    attr_accessor :id, :text, :code, :correct, :duration_in_milliseconds,
                  :created_at, :created_at_not_parsed

    alias_method :correct?, :correct
    alias_method :duration, :duration_in_milliseconds

    def created_at=(datetime)
      self.created_at_not_parsed = datetime
      @created_at = Time.parse(datetime)
    rescue
      datetime
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zero_captcha-1.0.0 lib/zero_captcha/models/captcha.rb