Class: Towsta::Kinds::MainKind
- Inherits:
-
Object
- Object
- Towsta::Kinds::MainKind
show all
- Defined in:
- lib/towsta/kinds/main.rb
Direct Known Subclasses
BooleanKind, DateKind, DatetimeKind, FileKind, FormatedKind, GalleryKind, ImageKind, IntegerKind, LinkKind, ListKind, MoneyKind, MultipleKind, PasswordKind, SelectKind, TextKind, UserKind, VerticalKind, VideoKind
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
#content ⇒ Object
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
|
#export ⇒ Object
28
29
30
|
# File 'lib/towsta/kinds/main.rb', line 28
def export
@content.to_s
end
|
#get ⇒ Object
12
13
14
|
# File 'lib/towsta/kinds/main.rb', line 12
def get
@content
end
|
#kind ⇒ Object
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
|