Class: ComponentizeAny::Witty::Interface

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Interface

Returns a new instance of Interface.



23
24
25
26
# File 'lib/componentize_any/dsl.rb', line 23

def initialize(name)
  @name = name
  @members = {}
end

Instance Attribute Details

#membersObject (readonly)

Returns the value of attribute members.



21
22
23
# File 'lib/componentize_any/dsl.rb', line 21

def members
  @members
end

#nameObject (readonly)

Returns the value of attribute name.



20
21
22
# File 'lib/componentize_any/dsl.rb', line 20

def name
  @name
end

Instance Method Details

#define(name, type, argdef, counterpart: nil) ⇒ Object



28
29
30
31
# File 'lib/componentize_any/dsl.rb', line 28

def define(name, type, argdef, counterpart: nil)
  memb = Member.new(name, type, argdef, counterpart)
  @members[name] = memb
end