Class: Metadata::AccessionedTag

Inherits:
Object
  • Object
show all
Defined in:
app/models/metadata.rb

Overview

rubocop:todo Style/Documentation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag, as = nil, services = [], downcase = false) ⇒ AccessionedTag

Returns a new instance of AccessionedTag.


70
71
72
73
74
75
# File 'app/models/metadata.rb', line 70

def initialize(tag, as = nil, services = [], downcase = false)
  @tag = tag
  @name = as || tag
  @services = [services].flatten.compact
  @downcase = downcase
end

Instance Attribute Details

#downcaseObject (readonly)

Returns the value of attribute downcase


68
69
70
# File 'app/models/metadata.rb', line 68

def downcase
  @downcase
end

#nameObject (readonly)

Returns the value of attribute name


68
69
70
# File 'app/models/metadata.rb', line 68

def name
  @name
end

#tagObject (readonly)

Returns the value of attribute tag


68
69
70
# File 'app/models/metadata.rb', line 68

def tag
  @tag
end

Instance Method Details

#for?(service) ⇒ Boolean

Returns:

  • (Boolean)

77
78
79
# File 'app/models/metadata.rb', line 77

def for?(service)
  @services.empty? || @services.include?(service)
end