Since classes are objects themselves, they also have methods. To define clas=
s methods,

class MyClass
  def self.my_method
    p self
  end
end

MyClass.my_method

Hope this helped.

On Dec 12, 2011, at 2:53 PM, rubythemystery ruby <rubythemystery / gmail.com> w=
rote:

> Hi all,
>=20
> Any help is appreciated.
>=20
> I have a class namely,
>=20
> class Web
>   include HTTParty
>=20
>   headers 'Accept' =3D> 'application/xml'
>   format :xml
>=20
> end
>=20
> And I have another class,
>=20
> class AtomFormats < HTTParty::Parser
>  include HTTParty
>  SupportedFormats.merge!(
>      {  "application/atom+xml" =3D> :atom}
>      )
>  def atom
>            headers 'Accept' =3D> 'application/atom+xml'
>      format :atom
>  end
> end
>=20
>=20
> I need to change the headers and format present in Class web to those
> parameters present in Class Atomformats.
>=20
> How can I make a call from Class web to Class Atomformats to make the
> change happen
>=20
> Thanks
>=20
> --=20
> Posted via http://www.ruby-forum.com/.
>=20