Sha256: 65bd439c559067205130e50d1080dfe12b0b19bda1b4e8714a08f2a8cde1a245

Contents?: true

Size: 416 Bytes

Versions: 4

Compression:

Stored size: 416 Bytes

Contents

module ActiveRecordSurvey
	# Text answers are... text answers
	class Node::Answer::Text < Node::Answer
		include Answer::Chained

		# 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

4 entries across 4 versions & 1 rubygems

Version Path
active_record_survey-0.1.28 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.27 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.26 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.25 lib/active_record_survey/node/answer/text.rb