Coder Social home page Coder Social logo

dasher-ruby's Introduction

Dasher Ruby Client

This client allows you to easily update screen data for Dasher. You can use this gem to easily push new data to any of your Dasher screens with ease.

Installation

Just install the gem into your Gemfile to get started.

gem "dasher-ruby", "~> 1.0", :require => "dasher"

Usage

# Getting screen and square information
Dasher.client.screens       #=>   Returns an array of screens
Dasher.client.screen(1)     #=>   Return information about a given screen by ID

# You can update a specific property quickly by providing the path to the property
# you want to change. You should provide the ID (or path) to the square, the
# key of the property you want to change and the new value.
Dasher.client.update_property(2, "number", 4001)
Dasher.client.update_property("screen1.signups", "number", 4001)

# Updating lists is also easy. You provide the square ID (or path), an optional
# identifier allowing you to remove/edit this item again in the future and the
# properties for the list item.
Dasher.client.add_list_item(2, nil, {"text" => "Some properties", "color" => "red"})

# You can also provide a full new list of updates. Screens will automatically
# remove, add or edit items as appropriate. Any items without identifiers will
# be removed.
Dasher.client.replace_list(2, [
  {"identifier" => "A", {"text" => "Some example text on row A"}},
  {"identifier" => "B", {"text" => "Some example text on row B"}}
])

The Dasher.client instance is automatically configured to use the production Dasher endpoints and the key in the DASHER_TOKEN environment variable. You can create your own clients if you would like.

client = Dasher::Client.new(host, token, :port => 443, :ssl => true)
client.screens
# etc...

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.