Module: AWS::Core::Model

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configConfiguration (readonly)



31
32
33
# File 'lib/aws/core/model.rb', line 31

def config
  @config
end

Instance Method Details

#clientObject

Each class including this module has its own client class. Generally it is the service namespace suffixed by client:

  • s3_client

  • simple_db_client



40
41
42
# File 'lib/aws/core/model.rb', line 40

def client
  @config.send("#{config_prefix}_client")
end

#config_prefixString



46
47
48
# File 'lib/aws/core/model.rb', line 46

def config_prefix
  Inflection.ruby_name(self.class.to_s.split(/::/)[1])
end

#initialize(*args) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/aws/core/model.rb', line 21

def initialize(*args)
  options = args.last.kind_of?(Hash) ? args.last : {}
  @config = case
  when options[:config] then options[:config]
  when args.first.respond_to?(:config) then args.first.config
  else AWS.config
  end
end

#inspectString



51
52
53
# File 'lib/aws/core/model.rb', line 51

def inspect
  "<#{self.class}>"
end