Class: PackageCloud::Object

Inherits:
Object
  • Object
show all
Defined in:
lib/package_cloud/object.rb

Direct Known Subclasses

GpgKey, MasterToken, ReadToken, Repository

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/package_cloud/object.rb', line 7

def method_missing(method, *args, &block)
  if @attrs.has_key?(method.to_s)
    @attrs[method.to_s]
  else
    super
  end
end

Instance Method Details

#respond_to?(method, include_priv = false) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/package_cloud/object.rb', line 3

def respond_to?(method, include_priv=false)
  @attrs.has_key?(method.to_s) || super
end