class RSpecApib::Element::Member

Represents a member in api-elements (api-elements.readthedocs.io/en/latest/)

Public Class Methods

from_hash(hash, index:, parent:) click to toggle source
Calls superclass method RSpecApib::Element::Base::from_hash
# File lib/rspec_apib/elements/member.rb, line 6
def self.from_hash(hash, index:, parent:)
  child = super
  content = child.content
  child.content = { content["key"] => content["value"] }
  child
end

Public Instance Methods

key() click to toggle source
# File lib/rspec_apib/elements/member.rb, line 13
def key
  content.keys.first
end
value() click to toggle source
# File lib/rspec_apib/elements/member.rb, line 17
def value
  content.values.first
end