Class: Towsta::Kinds::BooleanKind

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

Instance Attribute Summary

Attributes inherited from MainKind

#content

Instance Method Summary collapse

Methods inherited from MainKind

#compare, #compare_parameterized, #get, #initialize, #kind

Constructor Details

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

Instance Method Details

#exportObject



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

def export
  return '1' if @content.class == TrueClass
  '0'
end

#set(content) ⇒ Object



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

def set content
  return @content = content if [TrueClass, FalseClass].include? content.class
  @content = content.to_i == 1
end