Sha256: 14ea416962f72fcf56ac9af7a6ed842ebf97ab9839f93d467d3f76a237ac609a

Contents?: true

Size: 577 Bytes

Versions: 11

Compression:

Stored size: 577 Bytes

Contents

# frozen_string_literal: true

module Shark
  class Survey < Base
    extend SurveyService::Resource

    add_datetime_accessors :starts_at, :ends_at, :created_at, :updated_at

    def self.find(*args)
      super.first
    end

    def add_participant(attributes)
      SurveyParticipant.create(attributes.merge(survey_id: id))
    end

    def scheduled?
      flags.present? && flags.include?('scheduled')
    end

    def running?
      flags.present? && flags.include?('running')
    end

    def closed?
      flags.present? && flags.include?('closed')
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bima-shark-sdk-3.1.1 lib/shark/survey.rb
bima-shark-sdk-2.5.0 lib/shark/survey.rb
bima-shark-sdk-3.1.0 lib/shark/survey.rb
bima-shark-sdk-3.0.0 lib/shark/survey.rb
bima-shark-sdk-2.4.4 lib/shark/survey.rb
bima-shark-sdk-2.4.3 lib/shark/survey.rb
bima-shark-sdk-2.4.2 lib/shark/survey.rb
bima-shark-sdk-2.4.1 lib/shark/survey.rb
bima-shark-sdk-2.4.0 lib/shark/survey.rb
bima-shark-sdk-2.3.1 lib/shark/survey.rb
bima-shark-sdk-2.3.0 lib/shark/survey.rb