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.



1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
# File 'lib/ruby-macrodroid/actions.rb', line 1463

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



1489
1490
1491
1492
# File 'lib/ruby-macrodroid/actions.rb', line 1489

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