Class: Whisperer::Dsl::Headers

Inherits:
BaseDsl
  • Object
show all
Defined in:
lib/whisperer/dsl/headers.rb

Instance Attribute Summary

Attributes inherited from BaseDsl

#container

Instance Method Summary collapse

Methods inherited from BaseDsl

add_writer, build, #initialize, link_container_class, link_dsl

Constructor Details

This class inherits a constructor from Whisperer::BaseDsl

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth_id, *args) ⇒ Object (protected)



11
12
13
14
15
16
17
# File 'lib/whisperer/dsl/headers.rb', line 11

def method_missing(meth_id, *args)
  unless @container.respond_to?(meth_id)
    @container.attribute(meth_id, String)
  end

  @container.public_send("#{meth_id}=", *args)
end

Instance Method Details

#respond_to?(meth_id) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/whisperer/dsl/headers.rb', line 6

def respond_to?(meth_id)
  @container.respond_to?(meth_id)
end