Class: Metadata::AccessionedTag
- Inherits:
-
Object
- Object
- Metadata::AccessionedTag
- Defined in:
- app/models/metadata.rb
Instance Attribute Summary collapse
-
#downcase ⇒ Object
readonly
Returns the value of attribute downcase.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Instance Method Summary collapse
- #for?(service) ⇒ Boolean
-
#initialize(tag, as = nil, services = [], downcase = false) ⇒ AccessionedTag
constructor
A new instance of AccessionedTag.
Constructor Details
#initialize(tag, as = nil, services = [], downcase = false) ⇒ AccessionedTag
Returns a new instance of AccessionedTag.
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
#downcase ⇒ Object (readonly)
Returns the value of attribute downcase.
76 77 78 |
# File 'app/models/metadata.rb', line 76 def downcase @downcase end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
76 77 78 |
# File 'app/models/metadata.rb', line 76 def name @name end |
#tag ⇒ Object (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
85 86 87 |
# File 'app/models/metadata.rb', line 85 def for?(service) @services.empty? || @services.include?(service) end |