Class: Udb::PortfolioExtensionRequirement

Inherits:
Object
  • Object
show all
Extended by:
Forwardable, T::Sig
Includes:
Comparable
Defined in:
lib/udb/obj/portfolio.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, requirements, arch:, note: nil, req_id: nil, presence: nil) ⇒ PortfolioExtensionRequirement

Returns a new instance of PortfolioExtensionRequirement.



45
46
47
48
49
50
# File 'lib/udb/obj/portfolio.rb', line 45

def initialize(name, requirements, arch:, note: nil, req_id: nil, presence: nil)
  @ext_req = arch.extension_requirement(name, requirements)
  @note = note
  @req_id = req_id
  @presence = presence
end

Instance Attribute Details

#ext_reqObject (readonly)

Returns the value of attribute ext_req.



33
34
35
# File 'lib/udb/obj/portfolio.rb', line 33

def ext_req
  @ext_req
end

#noteObject (readonly)

Returns the value of attribute note.



33
34
35
# File 'lib/udb/obj/portfolio.rb', line 33

def note
  @note
end

#presenceObject (readonly)

Returns the value of attribute presence.



33
34
35
# File 'lib/udb/obj/portfolio.rb', line 33

def presence
  @presence
end

#req_idObject (readonly)

Returns the value of attribute req_id.



33
34
35
# File 'lib/udb/obj/portfolio.rb', line 33

def req_id
  @req_id
end

Instance Method Details

#<=>(other) ⇒ Object



53
54
55
56
57
58
59
60
# File 'lib/udb/obj/portfolio.rb', line 53

def <=>(other)
  case other
  when PortfolioExtensionRequirement
    @ext_req <=> other.ext_req
  when ExtensionRequirement
    @ext_req <=> other
  end
end