Class: BundlerDate::Spec

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler_date/spec.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#specObject (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_listObject



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

Returns:

  • (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