Class: String

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

Instance Method Summary collapse

Instance Method Details

#get_xsb_info_lineObject

In xsb files, an information line start with a semi-colon. I remove it, remove leading and trailing spaces and inject a newline to the end.

Examples:

> a = "; hello world !   \n"
> a.get_xsb_info_line
=> "hello world !\n"

See Also:

Since:

  • 0.74



11
12
13
# File 'lib/rsokoban/extensions.rb', line 11

def get_xsb_info_line
	self.get_xsb_info_line_chomp + "\n"
end

#get_xsb_info_line_chompObject

In xsb files, an information line start with a semi-colon. I remove it and also remove leading and trailing spaces.

Examples:

> a = "; hello world !   \n"
> a.get_xsb_info_line_chomp
=> "hello world !"

See Also:

Since:

  • 0.74



23
24
25
# File 'lib/rsokoban/extensions.rb', line 23

def get_xsb_info_line_chomp
	self.sub(/;/, '').strip
end