Class: Nemo::MetaObject::SingleRelationshipAttribute

Inherits:
RelationshipAttribute show all
Defined in:
lib/nemo/metaobject/attributes.rb

Instance Attribute Summary

Attributes inherited from Attribute

#cache, #metaobject, #symbol, #validation_rules

Instance Method Summary collapse

Methods inherited from Attribute

#add_required_rule, #add_validation_rule, #commit_cache, #error_class, #format, #formatted_value, #initialize, #refresh_cache, #required, #required?, #rule_class, #validate_cache, #value

Methods included from Util::Accessors

#bool_accessor, #call_accessor, #proc_accessor

Constructor Details

This class inherits a constructor from Nemo::MetaObject::Attribute

Instance Method Details

#accept(visitor) ⇒ Object



237
238
239
# File 'lib/nemo/metaobject/attributes.rb', line 237

def accept(visitor)
  visitor.visit_single_relationship_attribute(self)
end

#formatted_itemsObject



249
250
251
# File 'lib/nemo/metaobject/attributes.rb', line 249

def formatted_items
  @nil_item_string ? [@nil_item_string]+super : super
end

#has_nil_item?Boolean

Returns:

  • (Boolean)


241
242
243
# File 'lib/nemo/metaobject/attributes.rb', line 241

def has_nil_item?
  Nemo::Util.to_bool(@nil_item_string)
end

#itemsObject



245
246
247
# File 'lib/nemo/metaobject/attributes.rb', line 245

def items
  @nil_item_string ? [nil]+super : super
end