class Nucleo::Models::Tags

Public Class Methods

new(collection) click to toggle source
# File lib/nucleo/models/tags.rb, line 6
def initialize(collection)
  @collection = Array(collection)
end

Public Instance Methods

each(&block) click to toggle source
# File lib/nucleo/models/tags.rb, line 10
def each(&block)
  internal_collection.each(&block)
end
has_snippet?() click to toggle source

Returns true if there is a snipped

@return [Boolean]

# File lib/nucleo/models/tags.rb, line 17
def has_snippet?
  self.any?
end
Also aliased as: snippet?
snippet() click to toggle source

Returns the code snippet

@return [String]

# File lib/nucleo/models/tags.rb, line 25
def snippet
  self.map(&:snippet).join("\n")
end
snippet?()
Alias for: has_snippet?

Private Instance Methods

internal_collection() click to toggle source
# File lib/nucleo/models/tags.rb, line 30
def internal_collection
  @collection.map { |r| Nucleo::Models::Tag.new(r) }
end