Class: Roll::Metadata::FakeGem::Gem::Specification

Inherits:
Object
  • Object
show all
Defined in:
lib/roll/metadata.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Specification

Returns a new instance of Specification.

Yields:

  • (_self)

Yield Parameters:



313
314
315
316
# File 'lib/roll/metadata.rb', line 313

def initialize(&block)
  @fake_options = {}
  yield(self)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args) ⇒ Object



317
318
319
320
321
322
323
324
325
# File 'lib/roll/metadata.rb', line 317

def method_missing(sym, *args)
  name = sym.to_s
  case name
  when /=$/
    @fake_options[name.chomp('=')] = args.first
  else
    @fake_options[name]
  end
end

Instance Attribute Details

#fake_optionsObject (readonly)

Returns the value of attribute fake_options.



312
313
314
# File 'lib/roll/metadata.rb', line 312

def fake_options
  @fake_options
end