Giter Site home page Giter Site logo

onfleet's People

Contributors

amilligan avatar claycarpenter avatar davidvetrano avatar edymerchk avatar markwpiper avatar nbwar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

onfleet's Issues

Attribute keys for non-Onfleet objects are not being camelized

Hi there. We are trying to create a task with barcodes, and set the barcode scan to block completion. The attributes method is not correctly camelizing the keys for attributes which are not Onfleet (gem) objects, therefore these attributes are ignored by Onfleet.

Example:

Onfleet::Task.create(
  destination: '138473',
  recipients: ['13294713'],
  barcodes: [{ data: 'whatever', block_completion: true }]
)
def attributes
  attrs = Hash.new
  instance_variables.each do |var|
    str = var.to_s.gsub /^@/, ''
    if respond_to? "#{str}="
      instance_var = instance_variable_get(var)
      if klass = Util.object_classes[str]
        # Removed for readability
      else
        # The barcode is not an Onfleet object so the array is simply added to the attrs without 
        # camelizing the keys
        attrs[Util.to_camel_case_lower(str).to_sym] = instance_var
      end
    end
  end
  attrs
end

Thanks

CompleteBeforeBefore and CompleteAfterAfter params for Task list

http://docs.onfleet.com/docs/tasks#list-tasks

CompleteBeforeBefore and CompleteAfterAfter params do not seem to be supported for Onfleet::Task.list.

edit:

Onfleet::Task.list({completeBeforeBefore: to, completeAfterAfter: from}) returns a list of tasks, but it's the same as if the parameters were not passed. Onfleet::Task.list({worker: 'worker id'}) also returns all tasks, not just the ones by the worker. However Onfleet::Task.list({state: 1}) works.

rest-client dependency

Is there any reason why this gem depends on rest-client ~> 1.4?

I'm already using rest-client 2.0 and I'm pretty happy with it. I wouldn't want to downgrade.

skip_sms_notifications attribute does not save properly

For better or for worse the Onfleet API expects the skipSMSNotifications attribute to have all letters in SMS capitalized. When this gem camelcases attributes it uses the standard ruby approach to acronyms, resulting in skipSmsNotifications.

Unfortunately, Onfleet is picky and that attribute doesn't work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.