Class: ShareLocationAction

Inherits:
LocationAction show all
Defined in:
lib/ruby-macrodroid/actions.rb

Overview

Category: Location

Instance Attribute Summary

Attributes inherited from Action

#constraints

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from Action

#invoke

Methods included from ObjectX

#action_to_object, #object_create, #varify

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(obj = nil) ⇒ ShareLocationAction

Returns a new instance of ShareLocationAction.



1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
# File 'lib/ruby-macrodroid/actions.rb', line 1702

def initialize(obj=nil)
  
  h = if obj.is_a? Hash then
    obj
  elsif obj.is_a? Array
    e, macro = obj
    {variable: macro.set_var(e.text('item/description').to_s)}

  end      
  
  #super()

  options = {
    email: '',
    variable: {:string_value=>"", :name=>"", 
               :decimal_value=>0.0, :is_local=>true, :boolean_value=>false, 
               :exclude_from_log=>false, :int_value=>0, :type=>2},
    sim_id: 0,
    output_channel: 5,
    old_variable_format: true
  }
  #options[:variable].merge! h
  super(options.merge h)

end

Instance Method Details

#to_s(colour: false, indent: 0) ⇒ Object Also known as: to_summary



1728
1729
1730
1731
# File 'lib/ruby-macrodroid/actions.rb', line 1728

def to_s(colour: false, indent: 0)
  @s = 'Share Location' + "\n" + @h[:variable][:name] # + @h.inspect
  super()
end