Class: Attribute

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, block) ⇒ Attribute

Returns a new instance of Attribute.



2
3
4
5
# File 'lib/lurry/attribute.rb', line 2

def initialize(name, block)
  @name  = name
  @block = block
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



7
8
9
# File 'lib/lurry/attribute.rb', line 7

def block
  @block
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/lurry/attribute.rb', line 7

def name
  @name
end

Instance Method Details

#block_given?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/lurry/attribute.rb', line 9

def block_given?
  !@block.nil?
end