Module: PictureFrame::Predefined

Extended by:
Enumerable
Defined in:
lib/picture_frame/predefined.rb

Constant Summary collapse

TEMPLATES =
{
  :default   => %q{
+---+
| @ |
+---+
},
  :stars     => %q{
*****
* @ *
*****
},
  :slashes   => %q{
///////
// @ //
///////
},
  :hashes    => %q{
#####
# @ #
#####
},
  # FIXME there might be a problem with multibyte chars
  :ornate    => %q{
%=---=%
∥    ∥
|  @  |
∥    ∥
%=---=%
},
  :ephemeral => %q{
⌜   ⌝
  @
⌞   ⌟
},
  :box       => %q{
  +-----+
 /     /|
+-----+ |
|     | |
|  @  | |
|     | +
|     |/
+-----+
}
}.freeze

Class Method Summary collapse

Class Method Details

.defaultObject



9
10
11
# File 'lib/picture_frame/predefined.rb', line 9

def default
  TEMPLATES[:default]
end

.each(&block) ⇒ Object



22
23
24
# File 'lib/picture_frame/predefined.rb', line 22

def each(&block)
  TEMPLATES.keys.each(&block)
end

.listObject



26
27
28
# File 'lib/picture_frame/predefined.rb', line 26

def list
  TEMPLATES.keys.sort
end

.named(name) ⇒ Object



13
14
15
# File 'lib/picture_frame/predefined.rb', line 13

def named(name)
  TEMPLATES[name]
end

.randomObject



17
18
19
20
# File 'lib/picture_frame/predefined.rb', line 17

def random
  templates = TEMPLATES.values
  templates[rand(templates.size)]
end