Class: Metadata::AccessionedTag

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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


85
86
87
88
89
90
# File 'app/models/metadata.rb', line 85

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


84
85
86
# File 'app/models/metadata.rb', line 84

def downcase
  @downcase
end

#nameObject (readonly)

Returns the value of attribute name


84
85
86
# File 'app/models/metadata.rb', line 84

def name
  @name
end

#tagObject (readonly)

Returns the value of attribute tag


84
85
86
# File 'app/models/metadata.rb', line 84

def tag
  @tag
end

Instance Method Details

#for?(service) ⇒ Boolean


92
93
94
# File 'app/models/metadata.rb', line 92

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