Class: Script2md::Convert

Inherits:
Object
  • Object
show all
Defined in:
lib/script2md.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, language_type: nil) ⇒ Convert



11
12
13
14
# File 'lib/script2md.rb', line 11

def initialize(text, language_type: nil)
  @text = text
  @language_type = language_type
end

Instance Attribute Details

#language_typeObject (readonly)

Returns the value of attribute language_type.



16
17
18
# File 'lib/script2md.rb', line 16

def language_type
  @language_type
end

#textObject

Returns the value of attribute text.



16
17
18
# File 'lib/script2md.rb', line 16

def text
  @text
end

Instance Method Details

#convertObject



18
19
20
21
22
23
24
# File 'lib/script2md.rb', line 18

def convert
  remove_shebang!
  code_into_codeblock!
  headling_comment_to_plaintext!
  format!
  self
end