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

Returns a new instance of Convert.



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

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.



19
20
21
# File 'lib/script2md.rb', line 19

def language_type
  @language_type
end

#textObject

Returns the value of attribute text.



19
20
21
# File 'lib/script2md.rb', line 19

def text
  @text
end

Instance Method Details

#convertObject



21
22
23
24
25
26
27
# File 'lib/script2md.rb', line 21

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