class Decode::Language::Ruby::Attribute

A Ruby-specific attribute.

Public Instance Methods

long_form() click to toggle source
# File lib/decode/language/ruby/attribute.rb, line 39
def long_form
        if @node.location.line == @node.location.last_line
                @node.location.expression.source
        else
                short_form
        end
end
short_form() click to toggle source

The short form of the attribute. e.g. `attr :value`.

# File lib/decode/language/ruby/attribute.rb, line 30
def short_form
        case @node.type
        when :block
                "#{@name} { ... }"
        else
                @node.location.expression.source
        end
end