class Decode::Language::Ruby::Block

A Ruby-specific block which might carry other definitions.

Public Instance Methods

container?() click to toggle source

A block can sometimes be a container for other definitions.

# File lib/decode/language/ruby/block.rb, line 29
def container?
        true
end
convert(kind) click to toggle source
Calls superclass method Decode::Definition#convert
# File lib/decode/language/ruby/block.rb, line 59
def convert(kind)
        case kind
        when :attribute
                Attribute.new(@node, @name,
                        comments: @comments, parent: @parent, language: @language
                )
        else
                super
        end
end
long_form() click to toggle source

The long form of the block. e.g. `foo(:bar)`.

# File lib/decode/language/ruby/block.rb, line 45
def long_form
        if @node.location.line == @node.location.last_line
                @node.location.expression.source
        else
                @node.children[0].location.expression.source
        end
end
nested_name() click to toggle source
# File lib/decode/language/ruby/block.rb, line 33
def nested_name
        ".#{name}"
end
qualified_form() click to toggle source

The fully qualified name of the block. e.g. `::Barnyard::foo`.

# File lib/decode/language/ruby/block.rb, line 55
def qualified_form
        self.qualified_name
end
short_form() click to toggle source

The short form of the block. e.g. `foo`.

# File lib/decode/language/ruby/block.rb, line 39
def short_form
        @name.to_s
end