Module: Duxml::AttrNamePattern

Included in:
AttrNamePatternClass
Defined in:
lib/duxml/meta/grammar/pattern/attr_name_pattern.rb,
lib/duxml/meta/grammar/pattern/attr_name_pattern.rb

Instance Method Summary collapse

Instance Method Details

#abstract?Boolean

Returns true if subject does not have the attr_name; false otherwise.

Returns:

  • (Boolean)

    true if subject does not have the attr_name; false otherwise



27
28
29
# File 'lib/duxml/meta/grammar/pattern/attr_name_pattern.rb', line 27

def abstract?
  subject[attr_name].nil?
end

#descriptionObject



31
32
33
34
# File 'lib/duxml/meta/grammar/pattern/attr_name_pattern.rb', line 31

def description
  abstract? ? "#{subject.description} does not have #{relationship} [#{attr_name}]" :
      "#{subject.description}'s #{relationship} [#{attr_name}]"
end

#relationshipObject



22
23
24
# File 'lib/duxml/meta/grammar/pattern/attr_name_pattern.rb', line 22

def relationship
  'attribute'
end