Class: Precheck::ItemToCheck

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

Overview

each attribute on a app version is a single item. for example: .name, .keywords, .description, will all have a single item to represent them which includes their name and a more user-friendly name we can use to print out information

Direct Known Subclasses

TextItemToCheck, URLItemToCheck

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(item_name, friendly_name, is_optional = false) ⇒ ItemToCheck

Returns a new instance of ItemToCheck.



10
11
12
13
14
# File 'precheck/lib/precheck/item_to_check.rb', line 10

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

Instance Attribute Details

#friendly_nameObject

Returns the value of attribute friendly_name.



7
8
9
# File 'precheck/lib/precheck/item_to_check.rb', line 7

def friendly_name
  @friendly_name
end

#is_optionalObject

Returns the value of attribute is_optional.



8
9
10
# File 'precheck/lib/precheck/item_to_check.rb', line 8

def is_optional
  @is_optional
end

#item_nameObject

Returns the value of attribute item_name.



6
7
8
# File 'precheck/lib/precheck/item_to_check.rb', line 6

def item_name
  @item_name
end

Instance Method Details

#inspectObject



20
21
22
# File 'precheck/lib/precheck/item_to_check.rb', line 20

def inspect
  "#{self.class}(friendly_name: #{@friendly_name}, data: #{@item_data})"
end

#item_dataObject



16
17
18
# File 'precheck/lib/precheck/item_to_check.rb', line 16

def item_data
  not_implemented(__method__)
end

#to_sObject



24
25
26
# File 'precheck/lib/precheck/item_to_check.rb', line 24

def to_s
  "#{self.class}: #{item_name}: #{friendly_name}"
end