Is it normal for valid ruby code to be high lighted red in intellij? -
is next valid ruby code? intellij doesnt think so. ive filed ticket intellij want create sure codes ok.
i know wont intellij telling me attr_reader unknown confused.
class person attr_reader :first_name, :last_name def initialize @first_name = nil @last_name = nil end end
the reason im asking intellij highlighting attr_reader reddish typicaly syntax error. spend time doing java , scala i'm bit lost ruby. normal valid code high lighted red?
assigning instance variables nil "initialize" them not necessary. when first reference instance variable "initialized" nil. doesn't need called.
see example:
if false # => false @example end # => nil p @example # => nil
and attr_reader :name
, example, reference @name
, automatically assigned nil
until assigned else.
ruby intellij-idea
No comments:
Post a Comment