Class: Soup::Backends::ReadOnly

Inherits:
Base
  • Object
show all
Defined in:
lib/soup/backends/read_only.rb

Instance Method Summary collapse

Methods inherited from Base

#find

Constructor Details

#initialize(backend) ⇒ ReadOnly

Returns a new instance of ReadOnly.



4
5
6
# File 'lib/soup/backends/read_only.rb', line 4

def initialize(backend)
  @backend = backend
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object



12
13
14
# File 'lib/soup/backends/read_only.rb', line 12

def method_missing(*args)
  @backend.__send__(*args) if @backend.respond_to?(args.first)
end

Instance Method Details

#respond_to?(method) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/soup/backends/read_only.rb', line 16

def respond_to?(method)
  super || @backend.respond_to?(method)
end

#save_snip(*args) ⇒ Object



8
9
10
# File 'lib/soup/backends/read_only.rb', line 8

def save_snip(*args)
  false
end