Class: Towsta::Kinds::MainKind

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content = nil) ⇒ MainKind

Returns a new instance of MainKind.



8
9
10
# File 'lib/towsta/kinds/main.rb', line 8

def initialize content=nil
  self.set content
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



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

def content
  @content
end

Instance Method Details

#compare(object) ⇒ Object



20
21
22
# File 'lib/towsta/kinds/main.rb', line 20

def compare object
  self.get == object
end

#compare_parameterized(object) ⇒ Object



24
25
26
# File 'lib/towsta/kinds/main.rb', line 24

def compare_parameterized object
  self.get.to_s.parameterize == object.to_s.parameterize
end

#exportObject



28
29
30
# File 'lib/towsta/kinds/main.rb', line 28

def export
  @content.to_s
end

#getObject



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

def get
  @content
end

#kindObject



32
33
34
# File 'lib/towsta/kinds/main.rb', line 32

def kind
  self.class.to_s.split('::').last.gsub('Kind','').downcase
end

#set(content) ⇒ Object



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

def set content
  @content = content.to_s.gsub("\\'","'")
end