Module: RTM::AR::IO::TOYAML::TopicName

Defined in:
lib/rtm/activerecord/io/to_yaml.rb

Instance Method Summary collapse

Instance Method Details

#to_yaml(*a) ⇒ Object



80
81
82
# File 'lib/rtm/activerecord/io/to_yaml.rb', line 80

def to_yaml(*a)
  to_yaml_hash.to_yaml(*a)
end

#to_yaml_hash(*a) ⇒ Object



70
71
72
73
74
75
76
77
78
79
# File 'lib/rtm/activerecord/io/to_yaml.rb', line 70

def to_yaml_hash(*a)
  y={}
  y['reifier'] = reifier.to_yaml_ref if reifier
  y['item_identifiers'] = item_identifiers.map{|i| i.reference} unless item_identifiers.empty?
  y['value'] = value if value
  y['type'] = type.to_yaml_ref if type
  y['scope'] = scope.map{|i| i.to_yaml_hash} unless scope.empty?
  y['variants'] = variants.map{|i| i.to_yaml_hash} unless variants.empty?
  y
end