Class: DataProvider::Provider
- Inherits:
-
Object
- Object
- DataProvider::Provider
- Defined in:
- lib/data_provider/provider.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#identifier ⇒ Object
(also: #id)
readonly
Returns the value of attribute identifier.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(identifier, opts = {}, block = nil) ⇒ Provider
constructor
A new instance of Provider.
- #requirements ⇒ Object
Constructor Details
#initialize(identifier, opts = {}, block = nil) ⇒ Provider
7 8 9 10 11 |
# File 'lib/data_provider/provider.rb', line 7 def initialize(identifier, opts = {}, block = nil) @identifier = identifier = opts.is_a?(Hash) ? opts : {} @block = block || Proc.new end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
5 6 7 |
# File 'lib/data_provider/provider.rb', line 5 def block @block end |
#identifier ⇒ Object (readonly) Also known as: id
Returns the value of attribute identifier.
4 5 6 |
# File 'lib/data_provider/provider.rb', line 4 def identifier @identifier end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/data_provider/provider.rb', line 3 def end |
Instance Method Details
#requirements ⇒ Object
15 16 17 |
# File 'lib/data_provider/provider.rb', line 15 def requirements [[:requires]].flatten.compact end |