Class: Hypa::Attribute

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(properties = {}) ⇒ Attribute

Returns a new instance of Attribute.



9
10
11
12
# File 'lib/hypa.rb', line 9

def initialize(properties = {})
  @name = properties.delete(:name)
  @type = properties.delete(:type)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#to_hashObject



14
15
16
# File 'lib/hypa.rb', line 14

def to_hash
  { name: @name.to_s, type: @type.to_s }
end