The Crystal programming language | http://crystal-lang.org | Fund Crystal's development: http://is.gd/X7PRtI | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/
AlwaysInline
annotation was implied, or a way to opt in/out
undefined macro method 'Path#instance_vars'
confused me way longer than i wanna admit... it refers to Crystal::Macros::Path
and not Path
:P
macro derive_from(owner, *names)
\{% for name in names %}
\{% var = owner.resolve.instance_vars.find{ |v| v == name } %}
property \{{name}} : \{{var.type}}
\{% end %}
def initialize( \{{ names.map{ |n| "@#{n}".id }.join("").id }} )
end
\{% debug %}
end
struct Nomad::Config
include SimpleConfig::Configuration
options_from Common::Config, nomad_datacenters, nomad_base_url, nomad_ssl_ca, nomad_ssl_key, nomad_ssl_cert
end
def initialize(@nomad_base_url : URI)
is pretty much the same and less confusing