Class: Bashly::Script::Wrapper

Inherits:
Object
  • Object
show all
Includes:
Renderable
Defined in:
lib/bashly/script/wrapper.rb

Instance Attribute Summary collapse

Attributes included from Renderable

#render_options

Instance Method Summary collapse

Methods included from Renderable

#load_user_file, #render, #strings, #user_file_exist?, #user_file_path, #view_marker

Constructor Details

#initialize(command, function_name = nil) ⇒ Wrapper

Returns a new instance of Wrapper.



8
9
10
11
# File 'lib/bashly/script/wrapper.rb', line 8

def initialize(command, function_name = nil)
  @command = command
  @function_name = function_name
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



6
7
8
# File 'lib/bashly/script/wrapper.rb', line 6

def command
  @command
end

#function_nameObject (readonly)

Returns the value of attribute function_name.



6
7
8
# File 'lib/bashly/script/wrapper.rb', line 6

def function_name
  @function_name
end

Instance Method Details

#code(tab_indent: false) ⇒ Object



13
14
15
# File 'lib/bashly/script/wrapper.rb', line 13

def code(tab_indent: false)
  tab_indent ? base_code.expand_tabs : base_code
end