Class: WADL::HasDocs

Inherits:
CheapSchema show all
Defined in:
lib/wadl/has_docs.rb

Direct Known Subclasses

Application, HTTPMethod, Link, Option, Param, RepresentationFormat, RequestFormat, Resource, ResourceType, Resources, ResponseFormat

Constant Summary

Constant Summary

Constants inherited from CheapSchema

CheapSchema::ATTRIBUTES

Instance Attribute Summary

Attributes inherited from CheapSchema

#attributes, #href, #index_key, #parent

Instance Method Summary (collapse)

Methods inherited from CheapSchema

as_collection, as_member, contents_are_mixed_data, #dereference, #dereference_with_context, dereferencing_attr_accessor, dereferencing_instance_accessor, #each_attribute, #each_collection, #each_member, from_element, has_attributes, has_many, has_one, has_required, in_document, inherit, inherited, init, #initialize, #matches?, may_be_reference, may_be_reference?, #paths, #to_s

Constructor Details

This class inherits a constructor from WADL::CheapSchema

Instance Method Details

- (Object) define_singleton(r, sym, method)

Convenience method to define a no-argument singleton method on this object.



37
38
39
40
41
42
43
# File 'lib/wadl/has_docs.rb', line 37

def define_singleton(r, sym, method)
  name = r.send(sym)

  if name && name !~ /\W/ && !r.respond_to?(name) && !respond_to?(name)
    instance_eval(%Q{def #{name}\n#{method}('#{name}')\nend})
  end
end