Class: Shark::Survey

Inherits:
Base
  • Object
show all
Extended by:
Shark::SurveyService::Resource
Defined in:
lib/shark/survey.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

add_datetime_accessors

Class Method Details

.find(*args) ⇒ Object



9
10
11
# File 'lib/shark/survey.rb', line 9

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

Instance Method Details

#add_participant(attributes) ⇒ Object



13
14
15
# File 'lib/shark/survey.rb', line 13

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

#closed?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/shark/survey.rb', line 25

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

#running?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/shark/survey.rb', line 21

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

#scheduled?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/shark/survey.rb', line 17

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