class MokiRuby::Action

Attributes

action[RW]
client_name[RW]
id[RW]
item_name[RW]
last_seen[RW]
note[RW]
payload[RW]
status[RW]
third_party_user[RW]

Public Class Methods

from_hash(input_hash) click to toggle source
# File lib/moki_ruby/action.rb, line 5
def self.from_hash(input_hash)
  new_action = self.new

  new_action.id = input_hash["id"]
  new_action.last_seen = input_hash["lastSeen"]
  new_action.action = input_hash["action"]
  new_action.status = input_hash["status"]
  new_action.client_name = input_hash["clientName"]
  new_action.item_name = input_hash["itemName"]
  new_action.third_party_user = input_hash["thirdPartyUser"]
  new_action.payload = input_hash["payload"]
  new_action.note = input_hash["note"]

  new_action
end

Public Instance Methods

to_hash() click to toggle source
# File lib/moki_ruby/action.rb, line 21
def to_hash
  {
    "id" => self.id,
    "lastSeen" => self.last_seen,
    "action" => self.action,
    "status" => self.status,
    "clientName" => self.client_name,
    "itemName" => self.item_name,
    "thirdPartyUser" => self.third_party_user,
    "payload" => self.payload,
    "note" => self.note
  }
end