Class: ComponentizeAny::Witty::Member

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, argdef, counterpart = nil) ⇒ Member

Returns a new instance of Member.



41
42
43
44
45
46
47
48
49
50
# File 'lib/componentize_any/dsl.rb', line 41

def initialize(name, type, argdef, counterpart=nil)
  @name = name
  @type = type
  if argdef.size != 1
    raise "argdef must have exactly one key-value pair"
  end
  @args = argdef.keys[0]
  @return_value = argdef.values[0]
  @counterpart = counterpart || name
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



37
38
39
# File 'lib/componentize_any/dsl.rb', line 37

def args
  @args
end

#counterpartObject (readonly)

Returns the value of attribute counterpart.



39
40
41
# File 'lib/componentize_any/dsl.rb', line 39

def counterpart
  @counterpart
end

#nameObject (readonly)

Returns the value of attribute name.



35
36
37
# File 'lib/componentize_any/dsl.rb', line 35

def name
  @name
end

#return_valueObject (readonly)

Returns the value of attribute return_value.



38
39
40
# File 'lib/componentize_any/dsl.rb', line 38

def return_value
  @return_value
end

#typeObject (readonly)

Returns the value of attribute type.



36
37
38
# File 'lib/componentize_any/dsl.rb', line 36

def type
  @type
end