Skip to content

Commit

Permalink
Add bool methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Bezpalov committed Oct 20, 2016
1 parent 3fec5f5 commit 20dd559
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/raddocs/models.rb
Expand Up @@ -21,6 +21,10 @@ def examples
IndexExample.new(example)
end
end

def explanation?
!explanation.nil?
end
end

# Example model for the index page
Expand All @@ -42,7 +46,7 @@ def href

# Example page model
class Example
attr_reader :resource, :resource_explanation :description, :explanation, :parameters, :response_fields,
attr_reader :resource, :resource_explanation, :description, :explanation, :parameters, :response_fields,
:requests

def initialize(file)
Expand All @@ -61,6 +65,10 @@ def initialize(file)
def explanation?
!explanation.nil?
end

def resource_explanation?
!resource_explanation.nil?
end
end

# Guide page model
Expand Down

0 comments on commit 20dd559

Please sign in to comment.