Class: BundlerDate::Spec
- Inherits:
-
Object
- Object
- BundlerDate::Spec
- Defined in:
- lib/bundler_date/spec.rb
Instance Attribute Summary collapse
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
Instance Method Summary collapse
- #active_spec_list ⇒ Object
-
#initialize(spec) ⇒ Spec
constructor
A new instance of Spec.
- #method_missing(method_name, *args) ⇒ Object
- #respond_to_missing?(method_name, *args) ⇒ Boolean
Constructor Details
#initialize(spec) ⇒ Spec
Returns a new instance of Spec.
7 8 9 |
# File 'lib/bundler_date/spec.rb', line 7 def initialize(spec) @spec = spec end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/bundler_date/spec.rb', line 19 def method_missing(method_name, *args) if @spec.respond_to?(method_name) @spec.send(method_name, *args) else super end end |
Instance Attribute Details
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
5 6 7 |
# File 'lib/bundler_date/spec.rb', line 5 def spec @spec end |
Instance Method Details
#active_spec_list ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/bundler_date/spec.rb', line 11 def active_spec_list @active_spec_list ||= spec.source.specs .search(spec.name) .select { |s| s.match_platform(spec.platform) } .sort_by(&:version) end |
#respond_to_missing?(method_name, *args) ⇒ Boolean
27 28 29 |
# File 'lib/bundler_date/spec.rb', line 27 def respond_to_missing?(method_name, *args) @spec.respond_to?(method_name) or super end |