Class: GitCli::Delta::VCSItem

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, path, full) ⇒ VCSItem

Returns a new instance of VCSItem.



25
26
27
28
29
# File 'lib/git_cli/delta.rb', line 25

def initialize(type, path, full)
  @type = type
  @path = path
  @full = full
end

Instance Attribute Details

#fullObject (readonly)

Returns the value of attribute full.



24
25
26
# File 'lib/git_cli/delta.rb', line 24

def full
  @full
end

#pathObject (readonly)

Returns the value of attribute path.



24
25
26
# File 'lib/git_cli/delta.rb', line 24

def path
  @path
end

#typeObject (readonly)

Returns the value of attribute type.



24
25
26
# File 'lib/git_cli/delta.rb', line 24

def type
  @type
end

Instance Method Details

#<=>(val) ⇒ Object

support sort



32
33
34
35
36
37
38
# File 'lib/git_cli/delta.rb', line 32

def <=>(val)
  if val.is_a?(VCSItem)
    @path <=> val.path
  else
    false
  end
end

#==(val) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/git_cli/delta.rb', line 40

def ==(val)
  if val.is_a?(VCSItem)
    @path == val.path
  else
    false
  end
end