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 inherited from MacroObject

#to_h

Constructor Details

#initialize(obj = nil) ⇒ ShareLocationAction

Returns a new instance of ShareLocationAction.



1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
# File 'lib/ruby-macrodroid/actions.rb', line 1378

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



1404
1405
1406
1407
# File 'lib/ruby-macrodroid/actions.rb', line 1404

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