kigo 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/kigo.rb +11 -3
- data/lib/kigo/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: c145f433ee825472eefd5e19aa747ba7c96261c8
         | 
| 4 | 
            +
              data.tar.gz: 5b9eee48cabf888b64dc776628a0cdedd8df0f1c
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 61ddfe3bd290c0a9248c98651eea982e9f99423806786016130f727f1ea078ddf2cd60f5afe7206bfa98b4184993d899a94fe359eb3e8d18a40040e26d84580a
         | 
| 7 | 
            +
              data.tar.gz: bf214fde96eb285c6935777691e53495776d142c6aa9c167f7aaf81a27ef00916736bce9fa8a02df7a130ce834869eda70dde3f1d64f64c836917adf4744a29c
         | 
    
        data/lib/kigo.rb
    CHANGED
    
    | @@ -8,12 +8,12 @@ module Kigo | |
| 8 8 | 
             
              def self.wrap_request(end_point, request_method, data={}, headers={})
         | 
| 9 9 | 
             
                basic_auth = { username: Kigo.configuration.username, password: Kigo.configuration.password }
         | 
| 10 10 | 
             
                encoded_auth = "Basic #{Base64.strict_encode64("#{basic_auth[:username]}:#{basic_auth[:password]}")}"
         | 
| 11 | 
            -
                data = self.filter_params(data)
         | 
| 11 | 
            +
                data = self.filter_params(data) unless data.nil?
         | 
| 12 12 | 
             
                request_options = { method: request_method, headers: headers.merge(
         | 
| 13 13 | 
             
                    { 'Authorization' => encoded_auth,
         | 
| 14 14 | 
             
                      'Content-Type' => 'application/json' }
         | 
| 15 15 | 
             
                  ) }
         | 
| 16 | 
            -
                request_options = request_options.merge(request_method == :post ? { body: data.to_json } : { params: data.to_json })
         | 
| 16 | 
            +
                request_options = request_options.merge(request_method == :post ? { body: data.nil? ? "null" : data.to_json } : { params: data.nil? ? "null" : data.to_json })
         | 
| 17 17 | 
             
                Typhoeus::Request.new("#{APIUrl}#{end_point}", request_options)
         | 
| 18 18 | 
             
              end
         | 
| 19 19 |  | 
| @@ -121,13 +121,21 @@ module Kigo | |
| 121 121 |  | 
| 122 122 | 
             
              #Properties
         | 
| 123 123 | 
             
              def self.list_properties
         | 
| 124 | 
            -
                self.access('/listProperties', :post)
         | 
| 124 | 
            +
                self.access('/listProperties', :post, nil)
         | 
| 125 | 
            +
              end
         | 
| 126 | 
            +
             | 
| 127 | 
            +
              def self.list_properties_2
         | 
| 128 | 
            +
                self.access('/listProperties2', :post, nil)
         | 
| 125 129 | 
             
              end
         | 
| 126 130 |  | 
| 127 131 | 
             
              def self.read_property(property_id)
         | 
| 128 132 | 
             
                self.access('/readProperty', :post, { 'PROP_ID' => property_id })
         | 
| 129 133 | 
             
              end
         | 
| 130 134 |  | 
| 135 | 
            +
              def self.read_property_2(property_id)
         | 
| 136 | 
            +
                self.access('/readProperty2', :post, { 'PROP_ID' => property_id })
         | 
| 137 | 
            +
              end
         | 
| 138 | 
            +
             | 
| 131 139 | 
             
              def self.read_property_photo_file(property_id, photo_id)
         | 
| 132 140 | 
             
                self.access("/readPropertyPhotoFile", :post, { "PROP_ID" => property_id, "PHOTO_ID" => photo_id })
         | 
| 133 141 | 
             
              end
         | 
    
        data/lib/kigo/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: kigo
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.4
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Rijaludin Muhsin
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2014-09- | 
| 11 | 
            +
            date: 2014-09-24 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         |