Class: Towsta::Kinds::ListKind

Inherits:
MainKind
  • Object
show all
Defined in:
lib/towsta/kinds/list.rb

Instance Attribute Summary

Attributes inherited from MainKind

#content

Instance Method Summary collapse

Methods inherited from MainKind

#compare_parameterized, #get, #initialize, #kind

Constructor Details

This class inherits a constructor from Towsta::Kinds::MainKind

Instance Method Details

#compare(object) ⇒ Object



11
12
13
14
# File 'lib/towsta/kinds/list.rb', line 11

def compare object
  return @content.include? object if object.class == String
  @content == object
end

#exportObject



16
17
18
# File 'lib/towsta/kinds/list.rb', line 16

def export
  @content.join(', ')
end

#set(content) ⇒ Object



6
7
8
9
# File 'lib/towsta/kinds/list.rb', line 6

def set content
  return @content = content.join(', ').split(', ') if content.class == Array
  @content = content.to_s.split(', ')
end