Class: Useless::Doc::DSL::Domain
- Inherits:
-
Object
- Object
- Useless::Doc::DSL::Domain
show all
- Includes:
- Member
- Defined in:
- lib/useless/doc/dsl.rb
Instance Method Summary
collapse
Methods included from Member
#generate, included, #initialize
Instance Method Details
#api(name, &block) ⇒ Object
95
96
97
98
|
# File 'lib/useless/doc/dsl.rb', line 95
def api(name, &block)
api = API.build name: name, &block
@attributes[:apis] << api
end
|
#default_attributes ⇒ Object
71
72
73
|
# File 'lib/useless/doc/dsl.rb', line 71
def default_attributes
{ apis: [] }
end
|
#description(description) ⇒ Object
83
84
85
|
# File 'lib/useless/doc/dsl.rb', line 83
def description(description)
@attributes[:description] = description
end
|
#name ⇒ Object
75
76
77
|
# File 'lib/useless/doc/dsl.rb', line 75
def name
@attributes[:name] = name
end
|
#timestamp(timestamp) ⇒ Object
87
88
89
90
91
92
93
|
# File 'lib/useless/doc/dsl.rb', line 87
def timestamp(timestamp)
if timestamp.is_a?(String)
timestamp = Time.parse(timestamp)
end
@attributes[:timestamp] = timestamp
end
|
#url(url) ⇒ Object
79
80
81
|
# File 'lib/useless/doc/dsl.rb', line 79
def url(url)
@attributes[:url] = url
end
|