Class: Putter::FollowerData

Inherits:
Object
  • Object
show all
Defined in:
lib/putter/follower_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, proxy, options) ⇒ FollowerData

Returns a new instance of FollowerData.



5
6
7
8
9
# File 'lib/putter/follower_data.rb', line 5

def initialize(object, proxy, options)
  @proxy = proxy
  @proxied_methods = options[:methods] || []
  set_label(options[:label], object)
end

Instance Attribute Details

#labelObject

Returns the value of attribute label.



3
4
5
# File 'lib/putter/follower_data.rb', line 3

def label
  @label
end

Instance Method Details

#add_method?(method) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
18
# File 'lib/putter/follower_data.rb', line 11

def add_method?(method)
  return false if @proxy.instance_methods.include?(method)
  return true if @proxied_methods.include?(method)
  return true if is_whitelisted_method?(method)
  return false if is_blacklisted_method?(method)
  return false if is_ignored_method?(method)
  return true if @proxied_methods.empty?
end