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

Returns a new instance of AccessionedTag.

[View source]

78
79
80
81
82
83
# File 'app/models/metadata.rb', line 78

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.


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

def downcase
  @downcase
end

#nameObject (readonly)

Returns the value of attribute name.


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

def name
  @name
end

#tagObject (readonly)

Returns the value of attribute tag.


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

def tag
  @tag
end

Instance Method Details

#for?(service) ⇒ Boolean

Returns:

  • (Boolean)
[View source]

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

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