Last active
April 28, 2019 12:27
-
-
Save vladyio/3c98add48c225ece07b3debf79aa5ab4 to your computer and use it in GitHub Desktop.
Example of greek_abc usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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