module Jsm::Client::InstanceMethods

Public Class Methods

included(base) click to toggle source
# File lib/jsm/client.rb, line 8
    def self.included(base)
      base.class_eval <<-EOFILE, __FILE__, __LINE__
        private :jsm_set_state
      EOFILE
    end

Public Instance Methods

current_state() click to toggle source

able to get current state from here instead check from the targeted attribute

# File lib/jsm/client.rb, line 19
def current_state
  attr_state = state_machine.attribute_name
  instance_variable_get("@#{attr_state}".to_sym)
end
jsm_set_state(val) click to toggle source

used for set new state by JSM

# File lib/jsm/client.rb, line 25
def jsm_set_state(val)
  attr_state = state_machine.attribute_name
  instance_variable_set("@#{attr_state}".to_sym, val)
end
state_machine() click to toggle source
# File lib/jsm/client.rb, line 14
def state_machine
  self.class.respond_to?(:state_machine) ? self.class.state_machine : nil
end