Sha256: 487b50a40d3e06910f24993e851c414f5fbfdfc841f25738a4db3e1ff749dc1d

Contents?: true

Size: 472 Bytes

Versions: 20

Compression:

Stored size: 472 Bytes

Contents

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

		# 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

20 entries across 20 versions & 1 rubygems

Version Path
active_record_survey-0.1.49 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.48 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.47 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.46 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.45 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.44 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.43 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.42 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.41 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.40 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.39 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.38 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.37 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.36 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.35 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.34 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.32 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.31 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.30 lib/active_record_survey/node/answer/text.rb
active_record_survey-0.1.29 lib/active_record_survey/node/answer/text.rb