Class: Specific::Tag

Inherits:
Struct
  • Object
show all
Defined in:
lib/specific/tag.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



2
3
4
# File 'lib/specific/tag.rb', line 2

def name
  @name
end

Instance Method Details

#group?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/specific/tag.rb', line 7

def group?
  !!group_name
end

#group_nameObject



15
16
17
# File 'lib/specific/tag.rb', line 15

def group_name
  @group_name ||= (name.match(/^group_(.+)$/) || [])[1]
end

#idObject



11
12
13
# File 'lib/specific/tag.rb', line 11

def id
  @id ||= (name.match(/^id_(.+)$/) || [])[1]
end

#id?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/specific/tag.rb', line 3

def id?
  !!id
end