Class: Kamelopard::VSRAction

Inherits:
Object
  • Object
show all
Defined in:
lib/kamelopard/classes.rb

Overview

Viewsyncrelay action

Instance Attribute Summary collapse

Attributes inherited from Object

#comment, #kml_id, #master_only

Instance Method Summary collapse

Methods inherited from Object

#_alternate_to_kml, #change, #master_only?, parse, #to_kml

Constructor Details

#initialize(name, options = {}) ⇒ VSRAction

XXX Consider adding some constraints, so that things like @name and @action don’t go nil XXX Also ensure constraints and reset_constraints are hashes,

containing reasonable values, and reasonable keys ('latitude' vs.
:latitude, for instance)


2469
2470
2471
2472
2473
2474
2475
2476
2477
# File 'lib/kamelopard/classes.rb', line 2469

def initialize(name, options = {})
    @name = name
    @constraints = {}
    @repeat = 'DEFAULT'
    @input = 'ALL'
    super(options)

    DocumentHolder.instance.current_document.vsr_actions << self
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



2461
2462
2463
# File 'lib/kamelopard/classes.rb', line 2461

def action
  @action
end

#constraintsObject

Returns the value of attribute constraints.



2461
2462
2463
# File 'lib/kamelopard/classes.rb', line 2461

def constraints
  @constraints
end

#exit_actionObject

Returns the value of attribute exit_action.



2461
2462
2463
# File 'lib/kamelopard/classes.rb', line 2461

def exit_action
  @exit_action
end

#fail_countObject

Returns the value of attribute fail_count.



2461
2462
2463
# File 'lib/kamelopard/classes.rb', line 2461

def fail_count
  @fail_count
end

#initially_disabledObject

Returns the value of attribute initially_disabled.



2461
2462
2463
# File 'lib/kamelopard/classes.rb', line 2461

def initially_disabled
  @initially_disabled
end

#inputObject

Returns the value of attribute input.



2461
2462
2463
# File 'lib/kamelopard/classes.rb', line 2461

def input
  @input
end

#nameObject

Returns the value of attribute name.



2461
2462
2463
# File 'lib/kamelopard/classes.rb', line 2461

def name
  @name
end

#repeatObject

Returns the value of attribute repeat.



2461
2462
2463
# File 'lib/kamelopard/classes.rb', line 2461

def repeat
  @repeat
end

#reset_constraintsObject

Returns the value of attribute reset_constraints.



2461
2462
2463
# File 'lib/kamelopard/classes.rb', line 2461

def reset_constraints
  @reset_constraints
end

#tour_nameObject

Returns the value of attribute tour_name.



2461
2462
2463
# File 'lib/kamelopard/classes.rb', line 2461

def tour_name
  @tour_name
end

#verboseObject

Returns the value of attribute verbose.



2461
2462
2463
# File 'lib/kamelopard/classes.rb', line 2461

def verbose
  @verbose
end

Instance Method Details

#to_hashObject



2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
# File 'lib/kamelopard/classes.rb', line 2479

def to_hash
    a = {}
    a['name']               = @name               unless @name.nil?
    a['id']                 = @id                 unless @id.nil?
    a['input']              = @input              unless @input.nil?
    a['tour_name']          = @tour_name          unless @tour_name.nil?
    a['verbose']            = @verbose            unless @verbose.nil?
    a['fail_count']         = @fail_count         unless @fail_count.nil?
    a['action']             = @action             unless @action.nil?
    a['exit_action']        = @exit_action        unless @exit_action.nil?
    a['repeat']             = @repeat             unless @repeat.nil?
    a['initially_disabled'] = @initially_disabled unless @initially_disabled.nil?
    a['constraints']        = @constraints        unless @constraints.nil?
    a['reset_constraints']  = @reset_constraints  unless @reset_constraints.nil?
    a
end