Sha256: 730a4944a1d64ae4ea9dd4565b68ccf8bec3e89fdc629270bb32397b25ca63eb

Contents?: true

Size: 389 Bytes

Versions: 6

Compression:

Stored size: 389 Bytes

Contents

module ActiveRecordSurvey
	# Text answers are... text answers
	class Node::Answer::Text < Node::Answer
		# Text answers are considered answered if they have text entered
		def is_answered_for_instance?(instance)
			if instance_node = self.instance_node_for_instance(instance)
				# Answered if has text
				instance_node.value.to_s.strip.length > 0
			else
				false
			end
		end
	end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
active_record_survey-0.1.13 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.12 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.11 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.10 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.9 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.8 lib/active_record_survey/node/answer/text.rb