Sha256: db1e3ba0aa1930f50d51927e6a8fc54b69cfc33391204cce61b259098652a808

Contents?: true

Size: 1.03 KB

Versions: 13

Compression:

Stored size: 1.03 KB

Contents

module GeoCerts
  
  ##
  # The lowest level class/method to test your credentials and connectivity
  # with the GeoCerts API.  If everything is properly configured, then a call 
  # to GeoCerts::Hello.message('my message') will result in a response 
  # matching your message:
  # 
  #     hello = GeoCerts::Hello.message('testing')  # => <GeoCerts::Hello @hello="testing">
  #     hello.result                                # => 'testing'
  #     hello.hello                                 # => 'testing'
  #     'testing' == hello.result                   # => true
  # 
  class Hello < ApiObject
    
    attr_accessor :hello
    alias :result :hello
    
    
    ##
    # Pass any message in to Hello and if everything is properly configured,
    # you will receive back a matching message in the response result.
    # 
    def self.message(message)
      new(call_api { GeoCerts.api.hello(:hello => GeoCerts.escape(message)) })
    end
    
    
    def initialize(attributes = {})
      self.hello = attributes[:hello]
    end
    
  end
  
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
geocerts-1.0.1 lib/geo_certs/hello.rb
geocerts-1.0.0 lib/geo_certs/hello.rb
geocerts-0.0.25 lib/geo_certs/hello.rb
geocerts-0.0.24 lib/geo_certs/hello.rb
geocerts-0.0.23 lib/geo_certs/hello.rb
geocerts-0.0.22 lib/geo_certs/hello.rb
geocerts-0.0.21 lib/geo_certs/hello.rb
geocerts-0.0.20 lib/geo_certs/hello.rb
geocerts-0.0.19 lib/geo_certs/hello.rb
geocerts-0.0.18 lib/geo_certs/hello.rb
geocerts-0.0.17 lib/geo_certs/hello.rb
geocerts-0.0.16 lib/geo_certs/hello.rb
geocerts-0.0.15 lib/geo_certs/hello.rb