Class: Undies::NamedSource
- Inherits:
-
Object
- Object
- Undies::NamedSource
- Defined in:
- lib/undies/source.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#opts ⇒ Object
Returns the value of attribute opts.
-
#proc ⇒ Object
Returns the value of attribute proc.
Instance Method Summary collapse
- #==(other_named_source) ⇒ Object
- #args ⇒ Object
- #args=(values) ⇒ Object
-
#initialize(*args, &block) ⇒ NamedSource
constructor
A new instance of NamedSource.
Constructor Details
#initialize(*args, &block) ⇒ NamedSource
Returns a new instance of NamedSource.
77 78 79 80 |
# File 'lib/undies/source.rb', line 77 def initialize(*args, &block) args << block if block self.args = args end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
75 76 77 |
# File 'lib/undies/source.rb', line 75 def file @file end |
#opts ⇒ Object
Returns the value of attribute opts.
75 76 77 |
# File 'lib/undies/source.rb', line 75 def opts @opts end |
#proc ⇒ Object
Returns the value of attribute proc.
75 76 77 |
# File 'lib/undies/source.rb', line 75 def proc @proc end |
Instance Method Details
#==(other_named_source) ⇒ Object
82 83 84 85 86 |
# File 'lib/undies/source.rb', line 82 def ==(other_named_source) self.file == other_named_source.file && self.opts == other_named_source.opts && self.proc == other_named_source.proc end |
#args ⇒ Object
96 97 98 |
# File 'lib/undies/source.rb', line 96 def args [self.file, self.opts, self.proc] end |
#args=(values) ⇒ Object
88 89 90 91 92 93 94 |
# File 'lib/undies/source.rb', line 88 def args=(values) self.proc, self.opts, self.file = [ values.last.kind_of?(::Proc) ? values.pop : nil, values.last.kind_of?(::Hash) ? values.pop : {}, values.last.kind_of?(::String) ? values.pop : nil ] end |