Class: WEEL::Position

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

Overview

}}}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(position, uuid, detail = :at, passthrough = nil) ⇒ Position

:at or :after or :unmark



395
396
397
398
399
400
# File 'lib/weel.rb', line 395

def initialize(position, uuid, detail=:at, passthrough=nil) # :at or :after or :unmark
  @position = position
  @detail = detail
  @uuid = uuid
  @passthrough = passthrough
end

Instance Attribute Details

#detailObject

Returns the value of attribute detail.



394
395
396
# File 'lib/weel.rb', line 394

def detail
  @detail
end

#passthroughObject

Returns the value of attribute passthrough.



394
395
396
# File 'lib/weel.rb', line 394

def passthrough
  @passthrough
end

#positionObject (readonly)

{{{



393
394
395
# File 'lib/weel.rb', line 393

def position
  @position
end

#uuidObject (readonly)

{{{



393
394
395
# File 'lib/weel.rb', line 393

def uuid
  @uuid
end

Instance Method Details

#as_jsonObject



401
402
403
404
405
# File 'lib/weel.rb', line 401

def as_json(*)
  jsn = { 'position' => @position, 'uuid' => @uuid }
  jsn['passthrough'] = @passthrough if @passthrough
  jsn
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


412
413
414
# File 'lib/weel.rb', line 412

def eql?(other)
  to_s == other.to_s
end

#hashObject



415
416
417
# File 'lib/weel.rb', line 415

def hash
  to_s.hash
end

#to_json(*args) ⇒ Object



409
410
411
# File 'lib/weel.rb', line 409

def to_json(*args)
  as_json.to_json(*args)
end

#to_sObject



406
407
408
# File 'lib/weel.rb', line 406

def to_s
  as_json.to_s
end