Class: ProxyTo::Target
- Inherits:
-
Module
- Object
- Module
- ProxyTo::Target
- Defined in:
- lib/proxy_to/target.rb
Constant Summary collapse
- VALID =
/@?\S+/i
Instance Attribute Summary collapse
-
#methods ⇒ Object
(also: #methods?)
readonly
Returns the value of attribute methods.
-
#pretend ⇒ Object
(also: #pretend?)
readonly
Returns the value of attribute pretend.
- #target ⇒ Symbol readonly
Instance Method Summary collapse
-
#initialize(target, pretend: false, methods: false) ⇒ Target
constructor
A new instance of Target.
- #inspect ⇒ Object
Constructor Details
#initialize(target, pretend: false, methods: false) ⇒ Target
Returns a new instance of Target.
16 17 18 19 20 21 22 23 24 |
# File 'lib/proxy_to/target.rb', line 16 def initialize(target, pretend: false, methods: false) @target = target.to_sym @pretend = pretend @methods = methods proxy_methods! pretend_methods! if pretend? methods_method! if methods? end |
Instance Attribute Details
#methods ⇒ Object (readonly) Also known as: methods?
Returns the value of attribute methods.
12 13 14 |
# File 'lib/proxy_to/target.rb', line 12 def methods @methods end |
#pretend ⇒ Object (readonly) Also known as: pretend?
Returns the value of attribute pretend.
9 10 11 |
# File 'lib/proxy_to/target.rb', line 9 def pretend @pretend end |
#target ⇒ Symbol (readonly)
7 8 9 |
# File 'lib/proxy_to/target.rb', line 7 def target @target end |
Instance Method Details
#inspect ⇒ Object
26 27 28 |
# File 'lib/proxy_to/target.rb', line 26 def inspect "ProxyTo::Target(:to => :#{target}, :pretend => #{pretend})" end |