Class: IncludeTag::AccessionedTag
- Inherits:
-
Object
- Object
- IncludeTag::AccessionedTag
- Defined in:
- app/models/concerns/include_tag.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.
13 14 15 16 17 18 |
# File 'app/models/concerns/include_tag.rb', line 13 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.
11 12 13 |
# File 'app/models/concerns/include_tag.rb', line 11 def downcase @downcase end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'app/models/concerns/include_tag.rb', line 11 def name @name end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
11 12 13 |
# File 'app/models/concerns/include_tag.rb', line 11 def tag @tag end |
Instance Method Details
#for?(service) ⇒ Boolean
20 21 22 |
# File 'app/models/concerns/include_tag.rb', line 20 def for?(service) @services.empty? || @services.include?(service) end |