Skip to content

Instantly share code, notes, and snippets.

@vladyio
Last active April 28, 2019 12:27
Show Gist options
  • Save vladyio/3c98add48c225ece07b3debf79aa5ab4 to your computer and use it in GitHub Desktop.
Save vladyio/3c98add48c225ece07b3debf79aa5ab4 to your computer and use it in GitHub Desktop.
Example of greek_abc usage
require 'greek_abc'
abc = GreekABC::Alphabet
# Define method :Σ
define_method(abc.sigma.upper.to_sym) do |**args|
"#{args.keys.join(' + ')} = #{args.values.sum}"
end
Σ(x: 10, y: 20) # => "x + y = 30"
###################################################
include Math
instance_variable_set(:"@#{abc.beta.lower}", 60)
sin @β # => -0.30..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment