Class: Precheck::TextItemToCheck

Inherits:
ItemToCheck show all
Defined in:
precheck/lib/precheck/item_to_check.rb

Overview

if the data point we want to check is a text field (like ‘description’), we’ll use this object to encapsulate it this includes the text, the property name, and what that name maps to in plain english so that we can print out nice, friendly messages.

Instance Attribute Summary collapse

Attributes inherited from ItemToCheck

#friendly_name, #is_optional, #item_name

Instance Method Summary collapse

Methods inherited from ItemToCheck

#inspect, #to_s

Constructor Details

#initialize(text, item_name, friendly_name, is_optional = false) ⇒ TextItemToCheck

Returns a new instance of TextItemToCheck.



34
35
36
37
# File 'precheck/lib/precheck/item_to_check.rb', line 34

def initialize(text, item_name, friendly_name, is_optional = false)
  @text = text
  super(item_name, friendly_name, is_optional)
end

Instance Attribute Details

#textObject

Returns the value of attribute text.



32
33
34
# File 'precheck/lib/precheck/item_to_check.rb', line 32

def text
  @text
end

Instance Method Details

#item_dataObject



39
40
41
# File 'precheck/lib/precheck/item_to_check.rb', line 39

def item_data
  return text
end