Sha256: c6a2a23c9c72c9fbb69bc1570b49ae81a8d43564daf8fe0ac22cdd72ae81e242

Contents?: true

Size: 913 Bytes

Versions: 2

Compression:

Stored size: 913 Bytes

Contents

# typed: strict
# frozen_string_literal: true

require "sorbet-runtime"

require "nexus/invision/resources/question"
require "nexus/invision/value_object"

module Nexus
  module Invision
    module Resources
      # Member is a User with additional information about their membership.
      class Poll < T::Struct
        include ValueObject

        const :id, Integer
        # const :title, String
        # const :start_date, DateTime
        # const :closed, T::Boolean
        # const :closedDate, String
        # const :public, T::Boolean
        # const :votes, Integer
        # const :questions, T::Array[Question]

        class << self
          extend T::Sig

          sig { params(response: T::Hash[String, T.untyped]).returns(Poll) }
          def from_response(response)
            Poll.new(
              id: response["id"],
            )
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nexus-invision-1.11.0 lib/nexus/invision/resources/poll.rb
nexus-invision-1.10.2 lib/nexus/invision/resources/poll.rb