Class: Yarr::Query::Method

Inherits:
Sequel::Model
  • Object
show all
Defined in:
lib/yarr/query/method.rb

Overview

Method model

A method belongs to a class or a module and can be instance or class method. As far as the Ruby language goes this is a slight bend of reality, but mainly follows ri conventions.

Examples:

m = Yarr::Query::Method.where(name: '<<').first
m.name # => "<<"
m.flavour # => "instance"
m.url # => "https://ruby-doc.org/core-2.6/Array.html#method-i-3C-3C"
m.origin # => #<Yarr::Query::Origin @values={:id=>1, :name=>"core"}>
m.full_name # => "Array#<<"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#flavourString (readonly)

Returns 'class' or 'instance'.

Returns:

  • (String)

    'class' or 'instance'


# File 'lib/yarr/query/method.rb', line 27

#nameString (readonly)

Returns class name.

Returns:

  • (String)

    class name


# File 'lib/yarr/query/method.rb', line 27

#originOrigin (readonly)

Returns originating gem.

Returns:

  • (Origin)

    originating gem


# File 'lib/yarr/query/method.rb', line 27

#urlString (readonly)

Returns ri documentation for method.

Returns:

  • (String)

    ri documentation for method


# File 'lib/yarr/query/method.rb', line 27

Instance Method Details

#full_nameString

method name qualified with class# or class.

Returns:

  • (String)

    Class#name or Class.name


38
39
40
# File 'lib/yarr/query/method.rb', line 38

def full_name
  "#{klass.name}#{flavour_separator}#{name}"
end