Module: Writetheman::Article::Content

Included in:
Base
Defined in:
lib/writetheman/article/content.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#all_contentObject

Returns the value of attribute all_content.



5
6
7
# File 'lib/writetheman/article/content.rb', line 5

def all_content
  @all_content
end

#bodyObject

Returns the value of attribute body.



5
6
7
# File 'lib/writetheman/article/content.rb', line 5

def body
  @body
end

#headerObject

Returns the value of attribute header.



5
6
7
# File 'lib/writetheman/article/content.rb', line 5

def header
  @header
end

#header_paramsObject

Returns the value of attribute header_params.



5
6
7
# File 'lib/writetheman/article/content.rb', line 5

def header_params
  @header_params
end

#tagsObject

Returns the value of attribute tags.



5
6
7
# File 'lib/writetheman/article/content.rb', line 5

def tags
  @tags
end

Instance Method Details

#check_header_params_validObject



7
8
9
10
# File 'lib/writetheman/article/content.rb', line 7

def check_header_params_valid
  raise "title is empty in header params #{@header_params}" if !@header_params.include?('title') || @header_params['title'].empty?
  raise "date is empty in header params #{@header_params}" if !@header_params.include?('date') || @header_params['date'].empty?
end

#remove_content!Object



12
13
14
15
16
17
18
# File 'lib/writetheman/article/content.rb', line 12

def remove_content!
  @all_content = ''
  @body = ''
  @header = ''
  @header_params = {}
  @tags = ''
end