Class: Renderer::Entities::AttributeDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/renderer/entities/attribute_definition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent, model) ⇒ AttributeDefinition

Returns a new instance of AttributeDefinition.



8
9
10
11
12
13
14
15
16
# File 'lib/renderer/entities/attribute_definition.rb', line 8

def initialize(parent, model)
  @parent = parent
  @defined_by = model[:defined_by]
  @doc = model[:doc] # TODO
  @name = model[:name]
  @reader_visibility = model[:reader_visibility].to_sym
  @writer_visibility = model[:writer_visibility].to_sym
  @type = model[:type] # TODO
end

Instance Attribute Details

#defined_byObject (readonly)

Returns the value of attribute defined_by.



6
7
8
# File 'lib/renderer/entities/attribute_definition.rb', line 6

def defined_by
  @defined_by
end

#docObject (readonly)

Returns the value of attribute doc.



6
7
8
# File 'lib/renderer/entities/attribute_definition.rb', line 6

def doc
  @doc
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/renderer/entities/attribute_definition.rb', line 6

def name
  @name
end

#parentObject (readonly)

Returns the value of attribute parent.



6
7
8
# File 'lib/renderer/entities/attribute_definition.rb', line 6

def parent
  @parent
end

#reader_visibilityObject (readonly)

Returns the value of attribute reader_visibility.



6
7
8
# File 'lib/renderer/entities/attribute_definition.rb', line 6

def reader_visibility
  @reader_visibility
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/renderer/entities/attribute_definition.rb', line 6

def type
  @type
end

#writer_visibilityObject (readonly)

Returns the value of attribute writer_visibility.



6
7
8
# File 'lib/renderer/entities/attribute_definition.rb', line 6

def writer_visibility
  @writer_visibility
end

Instance Method Details

#accessor?Boolean

Returns:

  • (Boolean)


18
# File 'lib/renderer/entities/attribute_definition.rb', line 18

def accessor? = reader? && writer?

#reader?Boolean

Returns:

  • (Boolean)


19
# File 'lib/renderer/entities/attribute_definition.rb', line 19

def reader? = reader_visibility == :public

#writer?Boolean

Returns:

  • (Boolean)


20
# File 'lib/renderer/entities/attribute_definition.rb', line 20

def writer? = writer_visibility == :public