Class: Stackdo::MethodReference

Inherits:
Struct
  • Object
show all
Defined in:
lib/stackdo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



12
13
14
# File 'lib/stackdo.rb', line 12

def name
  @name
end

#receiverObject

Returns the value of attribute receiver

Returns:

  • (Object)

    the current value of receiver



12
13
14
# File 'lib/stackdo.rb', line 12

def receiver
  @receiver
end

Instance Method Details

#to_sObject



13
14
15
16
17
18
19
20
# File 'lib/stackdo.rb', line 13

def to_s
  case receiver
  when Module then "#{receiver}.#{name}"
  when Class then "#{receiver}##{name}"
  else
    receiver.to_s
  end
end