Class: Totsuzennoshi
- Inherits:
-
Object
- Object
- Totsuzennoshi
- Defined in:
- lib/totsuzennoshi.rb
Constant Summary collapse
- HEADER_LR =
"_"
- HEADER_BODY =
"人"
- HEADER_SPACE =
" "
- BODY_LEFT =
"> "
- BODY_RIGHT =
" <"
- FOOTER_LR =
" ̄"
- FOOTER_BODY =
"Y^"
- FOOTER_BODY_FILL =
"Y"
Class Method Summary collapse
- .header_parts(message) ⇒ Object
- .make_body(message) ⇒ Object
- .make_footer(message) ⇒ Object
- .make_header(message) ⇒ Object
- .totsuzennoshi(message) ⇒ Object
Class Method Details
.header_parts(message) ⇒ Object
17 18 19 20 21 |
# File 'lib/totsuzennoshi.rb', line 17 def self.header_parts() length = .size modarray = length.divmod(2) return [modarray[0] + modarray[1], modarray[0]] end |
.make_body(message) ⇒ Object
32 33 34 |
# File 'lib/totsuzennoshi.rb', line 32 def self.make_body() return "#{BODY_LEFT}#{}#{BODY_RIGHT}" end |
.make_footer(message) ⇒ Object
23 24 25 |
# File 'lib/totsuzennoshi.rb', line 23 def self.() return "#{FOOTER_LR}#{FOOTER_BODY*.size}#{FOOTER_BODY_FILL}#{FOOTER_LR}" end |
.make_header(message) ⇒ Object
27 28 29 30 |
# File 'lib/totsuzennoshi.rb', line 27 def self.make_header() parts = header_parts() return "#{HEADER_LR}#{HEADER_BODY*parts[0]}#{HEADER_SPACE}#{HEADER_BODY*parts[1]}#{HEADER_LR}" end |
.totsuzennoshi(message) ⇒ Object
13 14 15 |
# File 'lib/totsuzennoshi.rb', line 13 def self.totsuzennoshi() return "#{make_header()}\n#{make_body()}\n#{()}\n" end |