class Numerals::FormattingAspect

Public Class Methods

[](*args) click to toggle source
# File lib/numerals/formatting_aspect.rb, line 9
def self.[](*args)
  new *args
end
aspect(aspect, &blk) click to toggle source
# File lib/numerals/formatting_aspect.rb, line 17
def self.aspect(aspect, &blk)
  define_method :"set_#{aspect}!" do |*args|
    instance_exec(*args, &blk)
    self
  end
  define_method :"set_#{aspect}" do |*args|
    dup.send(:"set_#{aspect}!", *args)
  end
end
set(*args, &blk) click to toggle source
# File lib/numerals/formatting_aspect.rb, line 27
def self.set(*args, &blk)
  define_method :"set!" do |*args|
    instance_exec(*args, &blk)
    self
  end
end

Public Instance Methods

[](*args) click to toggle source
# File lib/numerals/formatting_aspect.rb, line 5
def [](*args)
  set *args
end
set(*args) click to toggle source
# File lib/numerals/formatting_aspect.rb, line 13
def set(*args)
  dup.set! *args
end