Class: Hypa::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/hypa.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Action

Returns a new instance of Action.



41
42
43
# File 'lib/hypa.rb', line 41

def initialize(&block)
  block.call(self) if block_given?
end

Instance Method Details

#href(value) ⇒ Object



49
50
51
# File 'lib/hypa.rb', line 49

def href(value)
  @href = value
end

#params(&block) ⇒ Object



53
54
55
# File 'lib/hypa.rb', line 53

def params(&block)
  @params = AttributeSet.new(&block)
end

#rel(value) ⇒ Object



45
46
47
# File 'lib/hypa.rb', line 45

def rel(value)
  @rel = value
end

#to_hashObject



57
58
59
# File 'lib/hypa.rb', line 57

def to_hash
  { rel: @rel.to_s, href: @href.to_s, params: @params.to_hash }
end