Module: Ksk::Post

Extended by:
ActiveSupport::Concern
Defined in:
lib/actives/post.rb

Instance Method Summary collapse

Instance Method Details

#apdown_textObject



20
21
22
# File 'lib/actives/post.rb', line 20

def apdown_text
  content
end

#content_has_more?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/actives/post.rb', line 45

def content_has_more?
  !hidden_text.blank?
end

#content_longObject



24
25
26
# File 'lib/actives/post.rb', line 24

def content_long
  "#{intro} #{hidden_text}"
end

#content_shortObject



28
29
30
# File 'lib/actives/post.rb', line 28

def content_short
  intro
end

#hidden_textObject



36
37
38
# File 'lib/actives/post.rb', line 36

def hidden_text
  split_content[1]
end

#introObject



32
33
34
# File 'lib/actives/post.rb', line 32

def intro
  split_content[0]
end

#split_contentObject



40
41
42
43
# File 'lib/actives/post.rb', line 40

def split_content
  return [] if read_attribute(:content).blank?
  read_attribute(:content).split('@@@')
end