module HALPresenter::Profile

Public Instance Methods

profile(value = Property::NO_VALUE, **kwargs, &block) click to toggle source
# File lib/hal_presenter/profile.rb, line 7
def profile(value = Property::NO_VALUE, **kwargs, &block)
  if value.nil? && !block_given?
    raise 'profile must be called with non nil value or be given a block'
  end

  kwargs[:context] ||= self
  @__semantic_profile = Property.new('profile', value, **kwargs, &block)
end
semantic_profile(object = nil, **kwargs) click to toggle source
# File lib/hal_presenter/profile.rb, line 16
def semantic_profile(object = nil, **kwargs)
  init_profile
  @__semantic_profile&.value(object, kwargs)
end

Private Instance Methods

init_profile() click to toggle source
# File lib/hal_presenter/profile.rb, line 23
def init_profile
  @__semantic_profile ||= __init_from_superclass(:init_profile, default: nil)
end